1
1
import asyncio
2
2
import inspect
3
- from collections .abc import AsyncGenerator , Awaitable , Callable , Coroutine
3
+ from collections .abc import AsyncGenerator , Awaitable , Callable
4
4
from contextlib import AsyncExitStack , asynccontextmanager
5
5
from dataclasses import dataclass , field
6
6
from functools import partial
7
7
from ssl import SSLContext
8
8
from types import TracebackType
9
- from typing import ClassVar , Literal , Self
9
+ from typing import Any , ClassVar , Literal , Self
10
10
11
11
from stompman .config import ConnectionParameters , Heartbeat
12
12
from stompman .connection import AbstractConnection , Connection
@@ -30,8 +30,8 @@ class Client:
30
30
PROTOCOL_VERSION : ClassVar = "1.2" # https://stomp.github.io/stomp-specification-1.2.html
31
31
32
32
servers : list [ConnectionParameters ] = field (kw_only = False )
33
- on_error_frame : Callable [[ErrorFrame ], None ] | None = None
34
- on_heartbeat : Callable [[], None ] | Callable [[], Awaitable [None ]] | None = None
33
+ on_error_frame : Callable [[ErrorFrame ], Any ] | None = None
34
+ on_heartbeat : Callable [[], Any ] | Callable [[], Awaitable [Any ]] | None = None
35
35
36
36
heartbeat : Heartbeat = field (default = Heartbeat (1000 , 1000 ))
37
37
ssl : Literal [True ] | SSLContext | None = None
@@ -146,11 +146,11 @@ async def begin(self) -> AsyncGenerator[Transaction, None]:
146
146
async def subscribe (
147
147
self ,
148
148
destination : str ,
149
- handler : Callable [[MessageFrame ], Coroutine [ None , None , None ]],
149
+ handler : Callable [[MessageFrame ], Awaitable [ Any ]],
150
150
* ,
151
151
ack : AckMode = "client-individual" ,
152
152
headers : dict [str , str ] | None = None ,
153
- on_suppressed_exception : Callable [[Exception , MessageFrame ], None ],
153
+ on_suppressed_exception : Callable [[Exception , MessageFrame ], Any ],
154
154
suppressed_exception_classes : tuple [type [Exception ], ...] = (Exception ,),
155
155
) -> "Subscription" :
156
156
subscription = Subscription (
0 commit comments