MCPcopy
hub / github.com/raiden-network/raiden / BlockTimeout

Class BlockTimeout

raiden/utils/timeout.py:20–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18
19
20class BlockTimeout: # pragma: no unittest
21 def __init__(
22 self,
23 exception_to_throw: Exception,
24 raiden: RaidenService,
25 block_number: BlockNumber,
26 retry_timeout: float,
27 ) -> None:
28 self.exception_to_throw = exception_to_throw
29 self.raiden = raiden
30 self.block_number = block_number
31 self.retry_timeout = retry_timeout
32 self._task: Optional[Greenlet] = None
33
34 def __enter__(self) -> None:
35 self._task = gevent.spawn(
36 _timeout_task,
37 gevent.getcurrent().throw,
38 self.exception_to_throw,
39 self.raiden,
40 self.block_number,
41 self.retry_timeout,
42 )
43 self._task.name = "timout_task"
44
45 def __exit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> None:
46 if self._task:
47 self._task.kill()

Callers 15

block_offset_timeoutFunction · 0.90
constants.pyFile · 0.85
settings.pyFile · 0.85
PythonApiConfigClass · 0.85
forward_transfer_pairFunction · 0.85
test_query_userFunction · 0.85
test_leave_token_networkFunction · 0.85
PFSMockClass · 0.85

Calls

no outgoing calls