forked from werogg/deprotocol
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfancy_app.py
More file actions
25 lines (17 loc) · 749 Bytes
/
fancy_app.py
File metadata and controls
25 lines (17 loc) · 749 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from multiprocessing import Event
from deprotocol.api.client import Client
from deprotocol.event.event_listener import Listener
from deprotocol.event.events.deprotocol_ready_event import DeProtocolReadyEvent
class DeProtocolReadyListener(Listener):
def __init__(self):
self.event = Event()
def handle_event(self, event: DeProtocolReadyEvent):
print("DeProtocol ready! Connecting")
self.event.set()
if __name__ == "__main__":
deprotocol_client = Client()
listener = DeProtocolReadyListener()
deprotocol_client.register_listener(listener)
deprotocol_client.start()
listener.event.wait()
deprotocol_client.connect(address="xd2cwgtvakfvx2ohu4px3gpjcahzv4irbo7um63iiowhhendso3d5did.onion")