rsb.transport.local¶
This package contains a highly efficient in-process transport implementation which allows participants inside one python process to communicate without serialization overhead.
Code author: jwienke
Functions
initialize () |
Classes
Bus () |
Singleton-like representation of the local bus. |
InPullConnector ([bus, converters, options]) |
|
InPushConnector ([bus, converters, options]) |
InPushConnector for the local transport. |
OutConnector ([bus, converters, options]) |
In-process OutConnector. |
TransportFactory |
TransportFactory implementation for the local transport. |
-
class
rsb.transport.local.
Bus
¶ Bases:
object
Singleton-like representation of the local bus.
Code author: jwienke
-
addSink
(sink)¶ Adds a sink for events pushed to the Bus.
Parameters: sink – the sink to add
-
getTransportURL
()¶
-
handle
(event)¶ Dispatches the provided event to all sinks of the appropriate scope.
Parameters: event (rsb.Event) – event to dispatch
-
removeSink
(sink)¶ Removes a sink to not be notified anymore.
Parameters: sink – sink to remove
-
-
class
rsb.transport.local.
InPullConnector
(bus=<rsb.transport.local.Bus object>, converters=None, options=None, **kwargs)¶ Bases:
rsb.transport.InPullConnector
-
activate
()¶
-
deactivate
()¶
-
getScope
()¶
-
getWireType
()¶ Returns the serialization type used for this connector.
Returns: python serialization type
-
handle
(event)¶
-
raiseEvent
(block)¶ Returns the next received event.
Parameters: block (bool) – If True
, wait for the next event, else immediately return, possiblyNone
.Returns: - rsb.Event or
None
- The next event or
None
ifblock
isFalse
.
- rsb.Event or
-
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
-
scope
¶
-
wireType
¶ Returns the serialization type used for this connector.
Returns: python serialization type
-
-
class
rsb.transport.local.
InPushConnector
(bus=<rsb.transport.local.Bus object>, converters=None, options=None, **kwargs)¶ Bases:
rsb.transport.InPushConnector
InPushConnector for the local transport.
Code author: jwienke
-
activate
()¶
-
deactivate
()¶
-
filterNotify
(filter, action)¶
-
getScope
()¶
-
getTransportURL
()¶
-
getWireType
()¶ Returns the serialization type used for this connector.
Returns: python serialization type
-
handle
(event)¶
-
setObserverAction
(action)¶ 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
-
scope
¶
-
wireType
¶ Returns the serialization type used for this connector.
Returns: python serialization type
-
-
class
rsb.transport.local.
OutConnector
(bus=<rsb.transport.local.Bus object>, converters=None, options=None, **kwargs)¶ Bases:
rsb.transport.OutConnector
In-process OutConnector.
Code author: jwienke
-
activate
()¶
-
deactivate
()¶
-
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
-
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
-
scope
¶
-
wireType
¶ Returns the serialization type used for this connector.
Returns: python serialization type
-
-
class
rsb.transport.local.
TransportFactory
¶ Bases:
rsb.transport.TransportFactory
TransportFactory
implementation for the local 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:
-
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
-
-
rsb.transport.local.
initialize
()¶