Skip to content

Commit

Permalink
change yroom class attribute to instance attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
Jialin Zhang committed Apr 30, 2024
1 parent aa48250 commit 88d0cf7
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions pycrdt_websocket/yroom.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from functools import partial
from inspect import isawaitable
from logging import Logger, getLogger
from typing import Awaitable, Callable
from typing import Awaitable, Callable, Tuple

from anyio import (
TASK_STATUS_IGNORED,
Expand Down Expand Up @@ -37,12 +37,11 @@ class YRoom:
_on_message: Callable[[bytes], Awaitable[bool] | bool] | None
_update_send_stream: MemoryObjectSendStream
_update_receive_stream: MemoryObjectReceiveStream
_task_group: TaskGroup | None = None
_started: Event | None = None
_task_group: TaskGroup | None
_started: Event | None
_stopped: Event
__start_lock: Lock | None = None
_subscription: Subscription | None = None

__start_lock: Lock | None
_subscription: Subscription | None
def __init__(
self,
ready: bool = True,
Expand Down Expand Up @@ -82,6 +81,13 @@ def __init__(
self._on_message = None
self.exception_handler = exception_handler
self._stopped = Event()
self._update_send_stream, self._update_receive_stream = create_memory_object_stream(
max_buffer_size=65536
)
self._task_group = None
self._started = None
self.__start_lock = None
self._subscription= None

@property
def _start_lock(self) -> Lock:
Expand Down

0 comments on commit 88d0cf7

Please sign in to comment.