You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cannot use one EmbeddedNotificationClient instance in multiple threads.
Your environment
Operating system
Database
Python version
To Reproduce
def test_create_client_multiple_threads(self):
import threading
from notification_service.embedded_notification_client import EmbeddedNotificationClient
from notification_service.event import Event, EventKey
client = EmbeddedNotificationClient(server_uri="localhost:50052", namespace='default', sender='sender')
def send_event():
event = Event(event_key=EventKey('key1'), message='a')
client.send_event(event)
print(client.sequence_number)
threads = []
for i in range(100):
thread = threading.Thread(target=send_event)
threads.append(thread)
for t in threads:
t.start()
for t in threads:
t.join()
Expected behavior
100 events sent.
Actual behavior
less than 100 events sent.
Screenshots
Additional context
The text was updated successfully, but these errors were encountered:
Describe the bug
Cannot use one EmbeddedNotificationClient instance in multiple threads.
Your environment
Operating system
Database
Python version
To Reproduce
Expected behavior
100 events sent.
Actual behavior
less than 100 events sent.
Screenshots
Additional context
The text was updated successfully, but these errors were encountered: