nanome.api.streams.stream module

class Stream(network, id, data_type, direction)[source]

Bases: object

Class allowing a update or read properties of a lot of structures
Created by calling create_writing_stream() or create_reading_stream()
When created, a stream is linked to a number of structures. Each call to update() will update all these structures
DataType

alias of nanome.util.enums.StreamDataType

Direction

alias of nanome.util.enums.StreamDirection

Type

alias of nanome.util.enums.StreamType

data_type
destroy()[source]
Destroy stream once plugin doesn’t need it anymore
direction
id
set_on_interrupt_callback(callback)[source]
Sets the function to call if the stream gets interrupted (crash)
set_update_received_callback(callback)[source]
Sets the function to call if the stream is reading and received an update
update(data, done_callback=None)[source]
Send data to the stream, updating all its atoms
Parameters:data (list of float for position and scale streams, list of byte for color streams) – List of data to send. i.e, for position stream: x, y, z, x, y, z, etc. (atom 1, atom 2, etc.)