def doSendMyIdentity(self, *args, **kwargs): """ Action method. """ p2p_service.SendIdentity(self.customer_idurl, wide=True, callbacks={ commands.Ack(): self._customer_acked, commands.Fail(): self._customer_failed, })
def doSendMyIdentityToUser(self, *args, **kwargs): """ Action method. """ def _on_ack(response, info): self.ping_response = time.time() self.automat('ack', response) p2p_service.SendIdentity( remote_idurl=self.remote_idurl, wide=True, timeout=5, callbacks={ commands.Ack(): _on_ack, commands.Fail(): lambda response, _: self.automat('fail', Exception(str(response))), None: lambda pkt_out: self.automat('fail', Exception('remote node not responding')), }, )
def doSendMyIdentity(self, arg): """ Action method. """ p2p_service.SendIdentity(self.target_idurl, wide=True)