grid.workers.socketio_server

Module Contents

class grid.workers.socketio_server.WebsocketIOServerWorker(hook, host: str, port: int, payload=None, id: Union[int, str] = 0, log_msgs: bool = False, verbose: bool = False, data: List[Union[torch.Tensor, AbstractTensor]] = None)

Bases: syft.workers.virtual.VirtualWorker

Objects of this class can act as a remote worker or as a plain socket IO.

By adding a payload to the object it will execute it forwarding the messages to the participants in the setup.

If no payload is added, this object will be a plain socketIO sitting between two clients that implement the protocol.

start(self)
_send_msg(self, message: bin)
_recv_msg(self, message: bin)

Forwards a message to the WebsocketIOClientWorker

_init_job_thread(self)
static _start_job_loop(loop)

Switch to new event loop and run forever

_start_payload(self)
terminate(self)