Channel is a generic/simple facility with the purpose of
making message passing and event dispatching as straightforward to use
as data structures :-).
template
<
class IdType,
class IdTrait = IdTrait<Id_Type>,
class SynchPolicy = ACE_MT_SYNCH,
class AllocPolicy,
class DispatchPolicy = BroadcastPolicy,
class Router = MapRouter<Id_Type, Id_Trait, SynchPolicy, AllocPolicy, DispatchPolicy>
>
class Channel
By replacing IdType, IdTrait and Router with various
concrete classes, Channel can support table/linear message routing,
hierarchical routing and associative routing (Linda style) at the
demand of user. We can use integer, string, POD structs
or any class as message ids (provided that proper operations are
defined with Id_Trait). And various dispatching methods can be plugged
in : broadcast_dispatch, round robin, random_dispatch, etc..
Channel provides complete publish/subscribe
interface for channel members (peer threads in message passing and
objects in event dispatching) to pub/sub message/event ids/types and
send/receive messages/events
Channels are process local entities which can be "connected" to
allow transparent distributed communication between members in
different channels (Connectors based on tcp socket and unix domain
socket are provided as samples)
Namespace control:
- The ids published/subscribed by channel members constitute
channel's namespace.
- Channel provides publish/subscribe scope control; When ids
are published/subscribed, peers can specify desired scope (LOCAL,
REMOTE, GLOBAL)
- When 2 channels are connected, their namespaces are
automatically "merged", which is transparent to both channel members
and programmers. Members can communicate with members in remote
channels the same way as with local members (by pub/sub ids).
- Namespace merge/integration is controlled by:
- Id scope specification
- filters and translators defined at channel connections
Channel communication are peer-2-peer; there are no central
daemons required for message passing.
Channel support both asynchronous message passing and synchronous
event dispatching models.
Channel is built on top of
ACE
(Adaptive Communication Environment) to gain platform independence.
News
- 3-15-2006:
- Complete port and build on WindowsXP with VC8
- Add dispatching policy as Channel template parameter to support
various dispatching algorithms; add Broadcast and simple RoundRobin
dispatching policies for testing
- Change Callback to functor style; so normal functions and
functors can be directly used as callbacks.
- 2-26-2006:
- message handling code clean up
- add hierarchical router based on Trie data structure and simple test
code
- add html user manual
- 2-14-2006:
- add SynchPolicy as a parameter of Channel template class
- convert channel design doc to html format
- add html design doc for CVM