Skip to content

Commit ebaa4cd

Browse files
committed
feat: add json
1 parent 85ce696 commit ebaa4cd

9 files changed

Lines changed: 24 additions & 6 deletions

src/socketio-stubs/async_aiopika_manager.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ from aio_pika.abc import (
66
AbstractRobustExchange,
77
)
88

9+
from socketio._types import JsonModule
910
from socketio.async_pubsub_manager import AsyncPubSubManager
1011

1112
class AsyncAioPikaManager(AsyncPubSubManager):
@@ -20,4 +21,5 @@ class AsyncAioPikaManager(AsyncPubSubManager):
2021
channel: str = ...,
2122
write_only: bool = ...,
2223
logger: logging.Logger | None = ...,
24+
json: JsonModule | None = ...,
2325
) -> None: ...

src/socketio-stubs/async_pubsub_manager.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import logging
33
from collections.abc import Callable
44
from typing import Any
55

6-
from socketio._types import DataType
6+
from socketio._types import DataType, JsonModule
77
from socketio.async_manager import AsyncManager
88

99
class AsyncPubSubManager(AsyncManager):
@@ -17,6 +17,7 @@ class AsyncPubSubManager(AsyncManager):
1717
channel: str = ...,
1818
write_only: bool = ...,
1919
logger: logging.Logger | None = ...,
20+
json: JsonModule | None = ...,
2021
) -> None: ...
2122
thread: asyncio.Task[Any]
2223
def initialize(self) -> None: ...

src/socketio-stubs/async_redis_manager.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ from redis.asyncio.client import PubSub as RedisPubSub
66
from valkey.asyncio import Valkey
77
from valkey.asyncio.client import PubSub as ValkeyPubSub
88

9-
from socketio._types import RedisArgs
9+
from socketio._types import JsonModule, RedisArgs
1010
from socketio.async_pubsub_manager import AsyncPubSubManager
1111

1212
def parse_redis_sentinel_url(
@@ -26,5 +26,6 @@ class AsyncRedisManager(AsyncPubSubManager):
2626
channel: str = ...,
2727
write_only: bool = ...,
2828
logger: logging.Logger | None = ...,
29+
json: JsonModule | None = ...,
2930
redis_options: dict[str, Any] | None = ...,
3031
) -> None: ...

src/socketio-stubs/base_manager.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ from typing import Any
44

55
from bidict import bidict
66

7+
from socketio._types import JsonModule
78
from socketio.base_server import BaseServer
89

910
default_logger: logging.Logger
@@ -17,6 +18,7 @@ class BaseManager:
1718
eio_to_sid: dict[str, str]
1819
callbacks: dict[str, dict[int, Callable[..., Any]]]
1920
pending_disconnect: dict[str, list[str]]
21+
json: JsonModule
2022
def __init__(self) -> None: ...
2123
def set_server(self, server: BaseServer[Any, Any]) -> None: ...
2224
def initialize(self) -> None: ...

src/socketio-stubs/kafka_manager.pyi

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import logging
22

33
import kafka
44

5+
from socketio._types import JsonModule
56
from socketio.pubsub_manager import PubSubManager
67

78
logger: logging.Logger
@@ -12,5 +13,10 @@ class KafkaManager(PubSubManager):
1213
producer: kafka.KafkaProducer
1314
consumer: kafka.KafkaConsumer
1415
def __init__(
15-
self, url: str = ..., channel: str = ..., write_only: bool = ...
16+
self,
17+
url: str = ...,
18+
channel: str = ...,
19+
write_only: bool = ...,
20+
logger: logging.Logger | None = ...,
21+
json: JsonModule | None = ...,
1622
) -> None: ...

src/socketio-stubs/kombu_manager.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ from typing import Any
33

44
import kombu
55

6+
from socketio._types import JsonModule
67
from socketio.pubsub_manager import PubSubManager
78

89
class KombuManager(PubSubManager):
@@ -19,6 +20,7 @@ class KombuManager(PubSubManager):
1920
channel: str = ...,
2021
write_only: bool = ...,
2122
logger: logging.Logger | None = ...,
23+
json: JsonModule | None = ...,
2224
connection_options: dict[str, Any] | None = ...,
2325
exchange_options: dict[str, Any] | None = ...,
2426
queue_options: dict[str, Any] | None = ...,

src/socketio-stubs/pubsub_manager.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ from collections.abc import Callable
33
from threading import Thread
44
from typing import Any
55

6-
from socketio._types import DataType
6+
from socketio._types import DataType, JsonModule
77
from socketio.manager import Manager
88

99
class PubSubManager(Manager):
@@ -17,6 +17,7 @@ class PubSubManager(Manager):
1717
channel: str = ...,
1818
write_only: bool = ...,
1919
logger: logging.Logger | None = ...,
20+
json: JsonModule | None = ...,
2021
) -> None: ...
2122
thread: Thread
2223
def initialize(self) -> None: ...

src/socketio-stubs/redis_manager.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ from redis.client import PubSub as RedisPubSub
66
from valkey import Valkey
77
from valkey.client import PubSub as ValkeyPubSub
88

9-
from socketio._types import RedisArgs
9+
from socketio._types import JsonModule, RedisArgs
1010
from socketio.pubsub_manager import PubSubManager
1111

1212
logger: logging.Logger
@@ -28,6 +28,7 @@ class RedisManager(PubSubManager):
2828
channel: str = ...,
2929
write_only: bool = ...,
3030
logger: logging.Logger | None = ...,
31+
json: JsonModule | None = ...,
3132
redis_options: dict[str, Any] | None = ...,
3233
) -> None: ...
3334
def initialize(self) -> None: ...

src/socketio-stubs/zmq_manager.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ from collections.abc import Generator
33

44
from eventlet.green.zmq import Socket, _Socket_recv
55

6+
from socketio._types import JsonModule
67
from socketio.pubsub_manager import PubSubManager
78

89
class ZmqManager(PubSubManager):
@@ -15,6 +16,7 @@ class ZmqManager(PubSubManager):
1516
url: str = ...,
1617
channel: str = ...,
1718
write_only: bool = ...,
18-
logger: logging.Logger = ...,
19+
logger: logging.Logger | None = ...,
20+
json: JsonModule | None = ...,
1921
) -> None: ...
2022
def zmq_listen(self) -> Generator[_Socket_recv]: ...

0 commit comments

Comments
 (0)