Performance improvements (#19)

* fix: increase the wait time for re-connecting to a relay

* fix: blocking sleep

* fix: remove blocking sleep

* fix: allow multiple filters per request
This commit is contained in:
Vlad Stan 2023-09-12 15:06:28 +03:00 committed by GitHub
parent 9d9fbc0189
commit e6624f76bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 18 deletions

View file

@ -1,4 +1,4 @@
import time
import asyncio
from typing import List
from ..relay_manager import RelayManager
@ -21,7 +21,7 @@ class NostrClient:
def close(self):
self.relay_manager.close_connections()
def subscribe(
async def subscribe(
self,
callback_events_func=None,
callback_notices_func=None,
@ -41,4 +41,4 @@ class NostrClient:
if callback_eosenotices_func:
callback_eosenotices_func(event_msg)
time.sleep(0.1)
await asyncio.sleep(0.5)