Skip to content

Commit 88d0cf7

Browse files
author
Jialin Zhang
committed
change yroom class attribute to instance attribute
1 parent aa48250 commit 88d0cf7

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

Diff for: pycrdt_websocket/yroom.py

+12-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from functools import partial
55
from inspect import isawaitable
66
from logging import Logger, getLogger
7-
from typing import Awaitable, Callable
7+
from typing import Awaitable, Callable, Tuple
88

99
from anyio import (
1010
TASK_STATUS_IGNORED,
@@ -37,12 +37,11 @@ class YRoom:
3737
_on_message: Callable[[bytes], Awaitable[bool] | bool] | None
3838
_update_send_stream: MemoryObjectSendStream
3939
_update_receive_stream: MemoryObjectReceiveStream
40-
_task_group: TaskGroup | None = None
41-
_started: Event | None = None
40+
_task_group: TaskGroup | None
41+
_started: Event | None
4242
_stopped: Event
43-
__start_lock: Lock | None = None
44-
_subscription: Subscription | None = None
45-
43+
__start_lock: Lock | None
44+
_subscription: Subscription | None
4645
def __init__(
4746
self,
4847
ready: bool = True,
@@ -82,6 +81,13 @@ def __init__(
8281
self._on_message = None
8382
self.exception_handler = exception_handler
8483
self._stopped = Event()
84+
self._update_send_stream, self._update_receive_stream = create_memory_object_stream(
85+
max_buffer_size=65536
86+
)
87+
self._task_group = None
88+
self._started = None
89+
self.__start_lock = None
90+
self._subscription= None
8591

8692
@property
8793
def _start_lock(self) -> Lock:

0 commit comments

Comments
 (0)