Skip to content

Commit f664c18

Browse files
committed
* Removed unnecessary async annotation from the parser.
1 parent 89c039f commit f664c18

16 files changed

+995
-1329
lines changed

swimai/client/_connections.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ async def _wait_for_messages(self) -> None:
179179
try:
180180
while self.status == _ConnectionStatus.RUNNING:
181181
message = await self.websocket.recv()
182-
response = await _Envelope._parse_recon(message)
182+
response = _Envelope._parse_recon(message)
183183
await self.__subscribers._receive_message(response)
184184
finally:
185185
await self._close()

swimai/client/_downlinks/_downlinks.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ class _EventDownlinkModel(_DownlinkModel):
302302

303303
async def _establish_downlink(self) -> None:
304304
link_request = _LinkRequest(self.node_uri, self.lane_uri)
305-
await self.connection._send_message(await link_request._to_recon())
305+
await self.connection._send_message(link_request._to_recon())
306306

307307
async def _receive_event(self, message: _Envelope) -> None:
308308
converter = RecordConverter.get_converter()
@@ -359,7 +359,7 @@ def __init__(self, client: 'SwimClient') -> None:
359359

360360
async def _establish_downlink(self) -> None:
361361
sync_request = _SyncRequest(self.node_uri, self.lane_uri)
362-
await self.connection._send_message(await sync_request._to_recon())
362+
await self.connection._send_message(sync_request._to_recon())
363363

364364
async def _receive_event(self, message: '_Envelope') -> None:
365365
await self.__set_value(message)
@@ -374,7 +374,7 @@ async def _send_message(self, message: '_Envelope') -> None:
374374
:param message: - Message to send to the remote agent.
375375
"""
376376
await self.linked.wait()
377-
await self.connection._send_message(await message._to_recon())
377+
await self.connection._send_message(message._to_recon())
378378

379379
async def _get_value(self) -> Any:
380380
"""
@@ -501,7 +501,7 @@ def __init__(self, client: 'SwimClient') -> None:
501501

502502
async def _establish_downlink(self) -> None:
503503
sync_request = _SyncRequest(self.node_uri, self.lane_uri)
504-
await self.connection._send_message(await sync_request._to_recon())
504+
await self.connection._send_message(sync_request._to_recon())
505505

506506
async def _receive_event(self, message: '_Envelope') -> None:
507507
if message._body._tag == 'update':
@@ -519,7 +519,7 @@ async def _send_message(self, message: '_Envelope') -> None:
519519
:param message: - Message to send to the remote agent.
520520
"""
521521
await self.linked.wait()
522-
await self.connection._send_message(await message._to_recon())
522+
await self.connection._send_message(message._to_recon())
523523

524524
async def _get_value(self, key) -> Any:
525525
"""
@@ -547,7 +547,7 @@ async def __receive_update(self, message: '_Envelope') -> None:
547547
self.downlink_manager.registered_classes,
548548
self.downlink_manager.strict)
549549

550-
recon_key = await Recon.to_string(message._body._get_head().value._get_head().value)
550+
recon_key = Recon.to_string(message._body._get_head().value._get_head().value)
551551
old_value = await self._get_value(recon_key)
552552

553553
self._map[recon_key] = (key, value)
@@ -558,7 +558,7 @@ async def __receive_remove(self, message: '_Envelope') -> None:
558558
self.downlink_manager.registered_classes,
559559
self.downlink_manager.strict)
560560

561-
recon_key = await Recon.to_string(message._body._get_head().value._get_head().value)
561+
recon_key = Recon.to_string(message._body._get_head().value._get_head().value)
562562
old_value = self._map.pop(recon_key, (Value.absent(), Value.absent()))[1]
563563

564564
await self.downlink_manager._subscribers_did_remove(key, old_value)

swimai/client/_swim_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ async def __send_command(self, host_uri: str, node_uri: str, lane_uri: str, body
203203
host_uri = _URI._normalise_warp_scheme(host_uri)
204204
message = _CommandMessage(node_uri, lane_uri, body=record)
205205
connection = await self._get_connection(host_uri)
206-
await connection._send_message(await message._to_recon())
206+
await connection._send_message(message._to_recon())
207207

208208
def __start_event_loop(self) -> None:
209209
asyncio.set_event_loop(self._loop)

0 commit comments

Comments
 (0)