11
11
TransportQueryError ,
12
12
TransportServerError ,
13
13
)
14
- from .websockets import WebsocketsTransport
14
+ from .websockets_base import WebsocketsTransportBase
15
15
16
16
log = logging .getLogger (__name__ )
17
17
@@ -24,7 +24,7 @@ def __init__(self, query_id: int) -> None:
24
24
self .unsubscribe_id : Optional [int ] = None
25
25
26
26
27
- class PhoenixChannelWebsocketsTransport (WebsocketsTransport ):
27
+ class PhoenixChannelWebsocketsTransport (WebsocketsTransportBase ):
28
28
"""The PhoenixChannelWebsocketsTransport is an async transport
29
29
which allows you to execute queries and subscriptions against an `Absinthe`_
30
30
backend using the `Phoenix`_ framework `channels`_.
@@ -54,7 +54,7 @@ def __init__(
54
54
self .subscriptions : Dict [str , Subscription ] = {}
55
55
super (PhoenixChannelWebsocketsTransport , self ).__init__ (* args , ** kwargs )
56
56
57
- async def _send_init_message_and_wait_ack (self ) -> None :
57
+ async def _initialize (self ) -> None :
58
58
"""Join the specified channel and wait for the connection ACK.
59
59
60
60
If the answer is not a connection_ack message, we will return an Exception.
@@ -131,6 +131,9 @@ async def _send_stop_message(self, query_id: int) -> None:
131
131
132
132
await self ._send (unsubscribe_message )
133
133
134
+ async def _stop_listener (self , query_id : int ) -> None :
135
+ await self ._send_stop_message (query_id )
136
+
134
137
async def _send_connection_terminate_message (self ) -> None :
135
138
"""Send a phx_leave message to disconnect from the provided channel."""
136
139
@@ -148,6 +151,9 @@ async def _send_connection_terminate_message(self) -> None:
148
151
149
152
await self ._send (connection_terminate_message )
150
153
154
+ async def _connection_terminate (self ):
155
+ await self ._send_connection_terminate_message ()
156
+
151
157
async def _send_query (
152
158
self ,
153
159
document : DocumentNode ,
0 commit comments