rsb.transport.rsbspread

This package contains a transport implementation based on the spread toolkit which uses a multicased-based daemon network.

Code author: jmoringe

Code author: jwienke

Functions

handleReceivedRegularMsg(message, …)
initialize()
makeKey(notification)

Classes

Assembly(fragment) A class that maintains a collection of fragments of one fragmented notification and assembles them if all fragments are received.
AssemblyPool() Maintains the parallel joining of notification fragments that are received in an interleaved fashion.
Connector(connection, **kwargs) Superclass for Spread-based connector classes.
InPullConnector(**kwargs)
InPushConnector(**kwargs)
OutConnector(**kwargs)
RefCountingSpreadConnection(daemonName[, …])
SpreadConnection(daemonName[, spreadModule]) A wrapper around a spread mailbox for some convenience.
SpreadReceiverTask(mailbox, observerAction, …) Thread used to receive messages from a spread connection.
TransportFactory() TransportFactory implementation for the spread transport.
class rsb.transport.rsbspread.Assembly(fragment)

Bases: object

A class that maintains a collection of fragments of one fragmented notification and assembles them if all fragments are received.

Code author: jwienke

add(fragment)
class rsb.transport.rsbspread.AssemblyPool

Bases: object

Maintains the parallel joining of notification fragments that are received in an interleaved fashion.

Code author: jwienke

add(fragment)
class rsb.transport.rsbspread.Connector(connection, **kwargs)

Bases: rsb.transport.Connector, rsb.transport.ConverterSelectingConnector

Superclass for Spread-based connector classes. This class manages the direction-independent aspects like the Spread connection and (de)activation.

Code author: jwienke

activate()
deactivate()
getConnection()
getConverterForDataType(dataType)

Returns a converter that can convert the supplied data to the wire-type.

Parameters:dataType – the type of the object for which a suitable converter should returned.
Returns:converter
Raises:KeyError – no converter is available for the supplied data.
getConverterForWireSchema(wireSchema)

Returns a suitable converter for the wireSchema.

Parameters:wireSchema (str) – the wire-schema to or from which the returned converter should convert
Returns:converter
Raises:KeyError – no converter is available for the specified wire-schema.
getConverterMap()
getScope()
getTransportURL()
getWireType()

Returns the serialization type used for this connector.

Returns:python serialization type
isActive()
setQualityOfServiceSpec(qos)
setScope(newValue)

Sets the scope this connector will receive events from to newValue. Called before #activate.

Parameters:newValue (rsb.Scope) – scope of the connector
MAX_MSG_LENGTH = 100000
active
connection
converterMap
scope
wireType

Returns the serialization type used for this connector.

Returns:python serialization type
class rsb.transport.rsbspread.InPullConnector(**kwargs)

Bases: rsb.transport.rsbspread.Connector, rsb.transport.InPullConnector

activate()
deactivate()
getConnection()
getConverterForDataType(dataType)

Returns a converter that can convert the supplied data to the wire-type.

Parameters:dataType – the type of the object for which a suitable converter should returned.
Returns:converter
Raises:KeyError – no converter is available for the supplied data.
getConverterForWireSchema(wireSchema)

Returns a suitable converter for the wireSchema.

Parameters:wireSchema (str) – the wire-schema to or from which the returned converter should convert
Returns:converter
Raises:KeyError – no converter is available for the specified wire-schema.
getConverterMap()
getScope()
getTransportURL()
getWireType()

Returns the serialization type used for this connector.

Returns:python serialization type
isActive()
raiseEvent(block)

Returns the next received event.

Parameters:block (bool) – If True, wait for the next event, else immediately return, possibly None.
Returns:
rsb.Event or None
The next event or None if block is False.
setQualityOfServiceSpec(qos)
setScope(scope)

Sets the scope this connector will receive events from to newValue. Called before #activate.

Parameters:newValue (rsb.Scope) – scope of the connector
MAX_MSG_LENGTH = 100000
active
connection
converterMap
scope
wireType

Returns the serialization type used for this connector.

Returns:python serialization type
class rsb.transport.rsbspread.InPushConnector(**kwargs)

Bases: rsb.transport.rsbspread.Connector, rsb.transport.InPushConnector

activate()
deactivate()
filterNotify(theFilter, action)
getConnection()
getConverterForDataType(dataType)

Returns a converter that can convert the supplied data to the wire-type.

Parameters:dataType – the type of the object for which a suitable converter should returned.
Returns:converter
Raises:KeyError – no converter is available for the supplied data.
getConverterForWireSchema(wireSchema)

Returns a suitable converter for the wireSchema.

Parameters:wireSchema (str) – the wire-schema to or from which the returned converter should convert
Returns:converter
Raises:KeyError – no converter is available for the specified wire-schema.
getConverterMap()
getScope()
getTransportURL()
getWireType()

Returns the serialization type used for this connector.

Returns:python serialization type
isActive()
setObserverAction(observerAction)

Sets the action used by the connector to notify about incoming events. The call to this method must be thread-safe.

Parameters:action – action called if a new message is received from the connector. Must accept an Event as parameter.
setQualityOfServiceSpec(qos)
setScope(scope)

Sets the scope this connector will receive events from to newValue. Called before #activate.

Parameters:newValue (rsb.Scope) – scope of the connector
MAX_MSG_LENGTH = 100000
active
connection
converterMap
scope
wireType

Returns the serialization type used for this connector.

Returns:python serialization type
class rsb.transport.rsbspread.OutConnector(**kwargs)

Bases: rsb.transport.rsbspread.Connector, rsb.transport.OutConnector

activate()
deactivate()
getConnection()
getConverterForDataType(dataType)

Returns a converter that can convert the supplied data to the wire-type.

Parameters:dataType – the type of the object for which a suitable converter should returned.
Returns:converter
Raises:KeyError – no converter is available for the supplied data.
getConverterForWireSchema(wireSchema)

Returns a suitable converter for the wireSchema.

Parameters:wireSchema (str) – the wire-schema to or from which the returned converter should convert
Returns:converter
Raises:KeyError – no converter is available for the specified wire-schema.
getConverterMap()
getScope()
getTransportURL()
getWireType()

Returns the serialization type used for this connector.

Returns:python serialization type
handle(event)

Sends event and adapts its meta data instance with the actual send time.

Parameters:event – event to send
isActive()
setQualityOfServiceSpec(qos)
setScope(newValue)

Sets the scope this connector will receive events from to newValue. Called before #activate.

Parameters:newValue (rsb.Scope) – scope of the connector
MAX_MSG_LENGTH = 100000
active
connection
converterMap
scope
wireType

Returns the serialization type used for this connector.

Returns:python serialization type
class rsb.transport.rsbspread.RefCountingSpreadConnection(daemonName, spreadModule=<module 'spread' from '/Users/jenkins/workspace/rsb-manual-0.16/env/lib/python2.7/spread.so'>)

Bases: rsb.transport.rsbspread.SpreadConnection

activate()
deactivate()
getHost()
getPort()
class rsb.transport.rsbspread.SpreadConnection(daemonName, spreadModule=<module 'spread' from '/Users/jenkins/workspace/rsb-manual-0.16/env/lib/python2.7/spread.so'>)

Bases: object

A wrapper around a spread mailbox for some convenience.

Code author: jwienke

activate()
deactivate()
getHost()
getPort()
class rsb.transport.rsbspread.SpreadReceiverTask(mailbox, observerAction, converterMap)

Bases: object

Thread used to receive messages from a spread connection.

Code author: jwienke

Constructor.

Parameters:
  • mailbox – spread mailbox to receive from
  • observerAction – callable to execute if a new event is received
  • converterMap – converters for data
interrupt()
setObserverAction(action)
class rsb.transport.rsbspread.TransportFactory

Bases: rsb.transport.TransportFactory

TransportFactory implementation for the spread transport.

Code author: jwienke

createInPullConnector(converters, options)

Creates a new instance of an InPullConnector for the represented transport.

Parameters:
  • converters (ConverterSelectionStrategy) – the converters to use for this type
  • options (dict of str) – options for the new connector
Returns:

the new connector instance

Return type:

rsb.transport.InPullConnector

createInPushConnector(converters, options)

Creates a new instance of an InPushConnector for the represented transport.

Parameters:converters (ConverterSelectionStrategy) – the converters to use for this type options(dict of str): options for the new connector
Returns:the new connector instance
Return type:rsb.transport.InPushConnector
createOutConnector(converters, options)

Creates a new instance of an OutConnector for the represented transport.

Parameters:converters (ConverterSelectionStrategy) – the converters to use for this type options(dict of str): options for the new connector
Returns:the new connector instance
Return type:rsb.transport.OutConnector
getName()

Returns the name representing this transport.

Returns:name of the transport, non-empty
Return type:str
isRemote()

Returns true is the transport performs remote communication.

Returns:does the transport perform remote communication?
Return type:bool
rsb.transport.rsbspread.handleReceivedRegularMsg(message, assemblyPool, converterMap)
rsb.transport.rsbspread.initialize()
rsb.transport.rsbspread.makeKey(notification)