11import asyncio
22import inspect
3- from collections .abc import AsyncGenerator , Awaitable , Callable , Coroutine
3+ from collections .abc import AsyncGenerator , Awaitable , Callable
44from contextlib import AsyncExitStack , asynccontextmanager
55from dataclasses import dataclass , field
66from functools import partial
77from ssl import SSLContext
88from types import TracebackType
9- from typing import ClassVar , Literal , Self
9+ from typing import Any , ClassVar , Literal , Self
1010
1111from stompman .config import ConnectionParameters , Heartbeat
1212from stompman .connection import AbstractConnection , Connection
@@ -30,8 +30,8 @@ class Client:
3030 PROTOCOL_VERSION : ClassVar = "1.2" # https://stomp.github.io/stomp-specification-1.2.html
3131
3232 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
3535
3636 heartbeat : Heartbeat = field (default = Heartbeat (1000 , 1000 ))
3737 ssl : Literal [True ] | SSLContext | None = None
@@ -146,11 +146,11 @@ async def begin(self) -> AsyncGenerator[Transaction, None]:
146146 async def subscribe (
147147 self ,
148148 destination : str ,
149- handler : Callable [[MessageFrame ], Coroutine [ None , None , None ]],
149+ handler : Callable [[MessageFrame ], Awaitable [ Any ]],
150150 * ,
151151 ack : AckMode = "client-individual" ,
152152 headers : dict [str , str ] | None = None ,
153- on_suppressed_exception : Callable [[Exception , MessageFrame ], None ],
153+ on_suppressed_exception : Callable [[Exception , MessageFrame ], Any ],
154154 suppressed_exception_classes : tuple [type [Exception ], ...] = (Exception ,),
155155 ) -> "Subscription" :
156156 subscription = Subscription (
0 commit comments