btnexus-node-python.btStreamingNode module

A Node which can stream binary data

class btStreamingNode.StreamingHelperNode(group, topic, funcName, callback=None, stream=None, **kwargs)[source]

Bases: btNode.Node

A Helper Node, which sends or receives streams

Constructor sets up the NexusConnector.

Parameters
  • token (String) – AccessToken for the btNexus

  • axonURL (String) – URL for the Axon(InstanceURL)

  • debug (bool) – switch for debug messages

  • logger (Logger) – a logger object to log to

  • personalityId (String) – Id of your Personality

  • integrationId (String) – Id of the integration this Node belongs to

onConnected()[source]

Is called when this node was connected This needs to be overloaded to subscribe to messages.

onStreamData(data)[source]
class btStreamingNode.StreamingNode(**kwargs)[source]

Bases: btNode.Node

A Node which can stream binary data

Constructor sets up the NexusConnector.

Parameters
  • token (String) – AccessToken for the btNexus

  • axonURL (String) – URL for the Axon(InstanceURL)

  • debug (bool) – switch for debug messages

  • logger (Logger) – a logger object to log to

  • personalityId (String) – Id of your Personality

  • integrationId (String) – Id of the integration this Node belongs to

publishStream(group, topic, funcName, stream, **kwargs)[source]

starts a Stream with the payload(funcName and params) to a topic.

Parameters
  • group (String) – Name of the group

  • topic (String) – Name of the topic

  • funcName (String) – Name of the function.

  • stream (stream) – a stream Object that will be stream to the group/topic/funcName

subscribeStream(group, topic, callback, funcName=None, **kwargs)[source]

Subscribe to a stream on group & topic with a callback

Parameters
  • group (String) – Name of the group

  • topic (String) – Name of the topic

  • callback (function pointer) – function pointer to the callback which expects one parameter as the incoming chunks of the stream

  • funcName (String) – Name of the function. If not set this is the name of the function in the implementation(needed if you want to link a function to a different name)

unpublishStream(group, topic, funcName, **kwargs)[source]
unsubscribeStream(group, topic, funcName, **kwargs)[source]