Package AccessGrid :: Module EventClient :: Class EventClient
[show private | hide private]
[frames | no frames]

Class EventClient


The Event Client maintains a client side connection to the Event Service to maintain state among a set of clients. This is done by sending events through the event service.


Method Summary
  __init__(self, privateId, location, channel)
The EventClient constructor takes a host, port.
  __del__(self)
  DefaultCallback(self, event)
  handleData(self, pdata)
  QueueThreadMain(self)
Event processing thread.
  readCallback(self, arg, handle, result, buf, n)
  readCallbackWrap(self, arg, handle, result, buf, n)
Asynch read callback.
  RegisterCallback(self, eventType, callback)
  RegisterObject(self, object)
RegisterObject is short hand for registering multiple callbacks on the same object.
  Send(self, data)
This method sends data to the Event Service.
  Start(self)
  start(self)
Register for asynch io.
  Stop(self)

Class Variable Summary
int bufsize = 4096                                                                  

Method Details

__init__(self, privateId, location, channel)
(Constructor)

The EventClient constructor takes a host, port.

QueueThreadMain(self)

Event processing thread.

This thread blocks on a read from the client-local event queue (self.queue). Commands on the form are tuples where tuple[0] is the name of the command.

Commands we process are

quit: Terminate the event processing thread. call: Invoke a callback. The callback is tuple[1], the event to pass to it is tuple[2].

readCallbackWrap(self, arg, handle, result, buf, n)

Asynch read callback.

We just use this to wrap the call to the readCallback itself, because the callback invocation mechanism silently ignores exceptions.

RegisterObject(self, object)

RegisterObject is short hand for registering multiple callbacks on the same object. The object being registered has to define a table named callbacks that has event types as keys, and self.methods as values. Then these are automatically registered.

Send(self, data)

This method sends data to the Event Service.

start(self)

Register for asynch io.


Class Variable Details

bufsize

Type:
int
Value:
4096                                                                  

Generated by Epydoc 2.1 on Thu Apr 14 16:39:26 2005 http://epydoc.sf.net