Ejemplo n.º 1
0
 def __init__(self, grid_descriptor, worker, destination, connections,
              conn_type):
     """ Create a new webrtc peer connection.
         
         Args:
             grid_descriptor: Grid network's websocket descriptor to forward webrtc connection request.
             worker: Virtual Worker that represents this peer.
             destination: Destination Peer ID.
             connections: Peer connection descriptors.
             conn_type: Connection responsabilities this peer should provide. (offer, answer)
     """
     threading.Thread.__init__(self)
     BaseWorker.__init__(self, hook=sy.hook, id=destination)
     self._conn_type = conn_type
     self._origin = worker.id
     self._worker = worker
     self._worker.tensor_requests = []
     self._destination = destination
     self._grid = grid_descriptor
     self._msg = ""
     self._request_pool = queue.Queue()
     self._response_pool = queue.Queue()
     self.channel = None
     self.available = True
     self.connections = connections
Ejemplo n.º 2
0
 def __init__(self, grid_descriptor, worker, destination, conn_type):
     threading.Thread.__init__(self)
     BaseWorker.__init__(self, hook=hook, id=destination)
     self._conn_type = conn_type
     self._origin = worker.id
     self._worker = worker
     self._destination = destination
     self._grid = grid_descriptor
     self._msg = ""
     self._request_pool = queue.Queue()
     self._response_pool = queue.Queue()
     self.channel = None