C# Class Brunet.Messaging.MultiSource

Provides multiple subscribers of an ISource.
Inheritance: ISource
Show file Open project: pstjuste/brunet Class Usage Examples

Protected Properties

Property Type Description
_subs System.Collections.ArrayList
_sync Object

Public Methods

Method Description
Announce ( MemBlock b, ISender return_path ) : int

Calls Handle on all IDataHandlers subscribed.

MultiSource ( ) : System

Initializes a MultiSource

Subscribe ( IDataHandler h, object state ) : void

Subscribes the out going data from this source to the specified handler.

Unsubscribe ( IDataHandler h ) : void

Unsubscribes the the IDataHandler if it is the current IDatahandler.

Method Details

Announce() public method

Calls Handle on all IDataHandlers subscribed.
public Announce ( MemBlock b, ISender return_path ) : int
b Brunet.Util.MemBlock The data being passed.
return_path ISender
return int

MultiSource() public method

Initializes a MultiSource
public MultiSource ( ) : System
return System

Subscribe() public method

Subscribes the out going data from this source to the specified handler.
public Subscribe ( IDataHandler h, object state ) : void
h IDataHandler
state object Data that the subscriber wants passed to the handler on each call.
return void

Unsubscribe() public method

Unsubscribes the the IDataHandler if it is the current IDatahandler.
public Unsubscribe ( IDataHandler h ) : void
h IDataHandler
return void

Property Details

_subs protected property

A list of all the subscribers.
protected ArrayList,System.Collections _subs
return System.Collections.ArrayList

_sync protected property

A lock to allow for multithreaded operations.
protected Object _sync
return Object