File tree Expand file tree Collapse file tree 2 files changed +14
-12
lines changed Expand file tree Collapse file tree 2 files changed +14
-12
lines changed Original file line number Diff line number Diff line change 10
10
AsyncRPCFilterRequestBuilder ,
11
11
)
12
12
from postgrest .constants import DEFAULT_POSTGREST_CLIENT_TIMEOUT
13
+ from realtime .connection import Socket
13
14
from storage3 import AsyncStorageClient
14
15
from storage3 .constants import DEFAULT_TIMEOUT as DEFAULT_STORAGE_CLIENT_TIMEOUT
15
16
from supafunc import AsyncFunctionsClient
@@ -80,12 +81,7 @@ def __init__(
80
81
auth_url = self .auth_url ,
81
82
client_options = options ,
82
83
)
83
- # TODO: Bring up to parity with JS client.
84
- # self.realtime: SupabaseRealtimeClient = self._init_realtime_client(
85
- # realtime_url=self.realtime_url,
86
- # supabase_key=self.supabase_key,
87
- # )
88
- self .realtime = None
84
+ self .realtime = self ._init_realtime_client (self .realtime_url , self .supabase_key )
89
85
self ._postgrest = None
90
86
self ._storage = None
91
87
self ._functions = None
@@ -273,6 +269,11 @@ def _init_postgrest_client(
273
269
verify = verify ,
274
270
)
275
271
272
+ @staticmethod
273
+ def _init_realtime_client (realtime_url : str , supabase_key : str ) -> Socket :
274
+ """Private helper for creating an instance of the Socket client."""
275
+ return Socket (realtime_url , supabase_key )
276
+
276
277
def _create_auth_header (self , token : str ):
277
278
return f"Bearer { token } "
278
279
Original file line number Diff line number Diff line change 10
10
SyncRPCFilterRequestBuilder ,
11
11
)
12
12
from postgrest .constants import DEFAULT_POSTGREST_CLIENT_TIMEOUT
13
+ from realtime .connection import Socket
13
14
from storage3 import SyncStorageClient
14
15
from storage3 .constants import DEFAULT_TIMEOUT as DEFAULT_STORAGE_CLIENT_TIMEOUT
15
16
from supafunc import SyncFunctionsClient
@@ -80,12 +81,7 @@ def __init__(
80
81
auth_url = self .auth_url ,
81
82
client_options = options ,
82
83
)
83
- # TODO: Bring up to parity with JS client.
84
- # self.realtime: SupabaseRealtimeClient = self._init_realtime_client(
85
- # realtime_url=self.realtime_url,
86
- # supabase_key=self.supabase_key,
87
- # )
88
- self .realtime = None
84
+ self .realtime = self ._init_realtime_client (self .realtime_url , self .supabase_key )
89
85
self ._postgrest = None
90
86
self ._storage = None
91
87
self ._functions = None
@@ -273,6 +269,11 @@ def _init_postgrest_client(
273
269
verify = verify ,
274
270
)
275
271
272
+ @staticmethod
273
+ def _init_realtime_client (realtime_url : str , supabase_key : str ) -> Socket :
274
+ """Private helper for creating an instance of the Socket client."""
275
+ return Socket (realtime_url , supabase_key )
276
+
276
277
def _create_auth_header (self , token : str ):
277
278
return f"Bearer { token } "
278
279
You can’t perform that action at this time.
0 commit comments