Main Page | Class Hierarchy | Alphabetical List | Class List | 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)
int run ()

Private Attributes

IEvent event
Buffer buffer
ProtocolReader reader
Cluster cluster
MulticastSocket consumer
void exception char[] msg

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 477 of file Cluster.d.

References Buffer, event, IEvent::getChannel(), Cluster::getGroup(), IChannel::getName(), MulticastSocket::join(), ProtocolReader, and SocketListener::start().

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 508 of file Cluster.d.

References event, IEvent::getChannel(), IChannel::getName(), ProtocolReader::getPayload(), and invoke().

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

Overridable mean of notifying the client code.

Reimplemented in MessageConsumer.

Definition at line 539 of file Cluster.d.

References IEvent::invoke().

Referenced by notify().

Cluster getCluster  )  [inline]
 

Return the cluster instance we're associated with.

Definition at line 550 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 563 of file Cluster.d.

References MulticastSocket::pauseGroup().

Referenced by MessageConsumer::invoke().

void resumeGroup  )  [inline]
 

Resume listening, post-pause.

Definition at line 574 of file Cluster.d.

References MulticastSocket::resumeGroup().

Referenced by MessageConsumer::invoke().

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 590 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 81 of file SocketListener.d.

public class VersionAltListener void start  )  [inline, inherited]
 

Definition at line 95 of file SocketListener.d.

Referenced by this().

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 137 of file SocketListener.d.

int run  )  [inline, 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 155 of file SocketListener.d.

References IBuffer::clear(), SocketListener::notify(), SocketListener::quit, ISocketReader::read(), and version.


Member Data Documentation

IEvent event [private]
 

Definition at line 463 of file Cluster.d.

Referenced by notify(), and this().

Buffer buffer [private]
 

Reimplemented from SocketListener.

Definition at line 464 of file Cluster.d.

ProtocolReader reader [private]
 

Reimplemented from SocketListener.

Definition at line 465 of file Cluster.d.

Cluster cluster [private]
 

Definition at line 466 of file Cluster.d.

MulticastSocket consumer [private]
 

Definition at line 467 of file Cluster.d.

void exception char [] msg [inherited]
 

Handle error conditions from the listener thread.

Definition at line 113 of file SocketListener.d.


The documentation for this class was generated from the following file:
Generated on Sun Nov 7 19:07:00 2004 for Mango by doxygen 1.3.6