Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

BulletinConsumer Class Reference

Inheritance diagram for BulletinConsumer:

SocketListener IConsumer MessageConsumer List of all members.

Public Member Functions

 this (Cluster cluster, IEvent event)
void notify (IBuffer buffer)
Cluster getCluster ()
void pauseGroup ()
void resumeGroup ()
void cancel ()

Protected Member Functions

void invoke (IEvent event, IPayload payload)

Private Member Functions

 this (ISocketReader reader, IBuffer buffer)
public class VersionAltListener
void 
start ()
void setErrorLimit (ushort limit)
ThreadReturn run ()

Private Attributes

IEvent event
Buffer buffer
ProtocolReader reader
Cluster cluster
MulticastSocket consumer
void exception char[] msg
public class VersionAres typedef
void 
ThreadReturn
else typedef int ThreadReturn

Member Function Documentation

this Cluster  cluster,
IEvent  event
[inline]
 

Construct a multicast consumer for the specified event. The event handler will be invoked whenever a message arrives for the associated channel.

Reimplemented in MessageConsumer.

Definition at line 482 of file Cluster.d.

References Buffer, and ProtocolReader.

void notify IBuffer  buffer  )  [inline]
 

Notification callback invoked when we receive a multicast packet. Note that we check the packet channel-name against the one we're consuming, to check for cases where the group address had a hash collision.

Reimplemented from SocketListener.

Definition at line 513 of file Cluster.d.

void invoke IEvent  event,
IPayload  payload
[inline, protected]
 

Overridable mean of notifying the client code.

Reimplemented in MessageConsumer.

Definition at line 544 of file Cluster.d.

References IEvent::invoke().

Cluster getCluster  )  [inline]
 

Return the cluster instance we're associated with.

Definition at line 555 of file Cluster.d.

void pauseGroup  )  [inline]
 

Temporarily halt listening. This can be used to ignore multicast messages while, for example, the consumer is busy doing other things.

Definition at line 568 of file Cluster.d.

void resumeGroup  )  [inline]
 

Resume listening, post-pause.

Definition at line 579 of file Cluster.d.

void cancel  )  [inline]
 

Cancel this consumer. The listener is effectively disabled from this point forward. The listener thread does not halt at this point, but waits until the socket-read returns. Note that the D Interface implementation requires us to "reimplement and dispatch" trivial things like this ~ it's a pain in the neck to maintain.

Reimplemented from IConsumer.

Definition at line 595 of file Cluster.d.

this ISocketReader  reader,
IBuffer  buffer
[inline, inherited]
 

Construct a listener with the requisite arguments. The specified buffer is populated via the provided instance of ISocketReader before being passed to the notify() method. All arguments are required.

Definition at line 84 of file SocketListener.d.

References assert().

public class VersionAltListener void start  )  [inline, inherited]
 

Definition at line 98 of file SocketListener.d.

void setErrorLimit ushort  limit  )  [inline, inherited]
 

Set the maximum contiguous number of exceptions this listener will survive. Setting a limit of zero will not survive any errors at all, whereas a limit of two will survive as long as two consecutive errors don't arrive back to back.

Definition at line 140 of file SocketListener.d.

ThreadReturn run  )  [inline, inherited]
 

Definition at line 163 of file SocketListener.d.

References IBuffer::clear(), printf(), ISocketReader::read(), version, and x.


Member Data Documentation

IEvent event [private]
 

Definition at line 468 of file Cluster.d.

Buffer buffer [private]
 

Reimplemented from SocketListener.

Definition at line 469 of file Cluster.d.

ProtocolReader reader [private]
 

Reimplemented from SocketListener.

Definition at line 470 of file Cluster.d.

Cluster cluster [private]
 

Definition at line 471 of file Cluster.d.

MulticastSocket consumer [private]
 

Definition at line 472 of file Cluster.d.

void exception char [] msg [inherited]
 

Handle error conditions from the listener thread.

Definition at line 116 of file SocketListener.d.

public class VersionAres typedef void ThreadReturn [inherited]
 

Execution of this thread is typically stalled on the read() method belonging to the ISocketReader specified during construction. You can invoke cancel() to indicate execution should not proceed further, but that will not actually interrupt a blocked read() operation.

Note that exceptions are all directed towards the handler implemented by the class instance.

Definition at line 158 of file SocketListener.d.

else typedef int ThreadReturn [inherited]
 

Definition at line 161 of file SocketListener.d.


The documentation for this class was generated from the following file:
Generated on Fri Nov 11 18:44:30 2005 for Mango by  doxygen 1.4.0