Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes typos #338

Merged
merged 1 commit into from
Aug 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/clustered.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ async def subscribe_handler(msg):
print("Connection closed prematurely.")
break
except ErrTimeout as e:
print("Timeout occured when publishing msg i={}: {}".format(
print("Timeout occurred when publishing msg i={}: {}".format(
i, e))

end_time = datetime.now()
Expand Down
8 changes: 4 additions & 4 deletions nats/aio/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ async def _close(self, status: int, do_cbs: bool = True) -> None:
):
self._reconnection_task.cancel()

# Wait for the reconection task to be done which should be soon.
# Wait for the reconnection task to be done which should be soon.
try:
if self._reconnection_task_future is not None and not self._reconnection_task_future.cancelled(
):
Expand Down Expand Up @@ -1064,7 +1064,7 @@ def client_id(self) -> Optional[str]:
@property
def last_error(self) -> Optional[Exception]:
"""
Returns the last error which may have occured.
Returns the last error which may have occurred.
"""
return self._err

Expand Down Expand Up @@ -1255,7 +1255,7 @@ async def _process_err(self, err_msg: str) -> None:

async def _process_op_err(self, e: Exception) -> None:
"""
Process errors which occured while reading or parsing
Process errors which occurred while reading or parsing
the protocol. If allow_reconnect is enabled it will
try to switch the server to which it is currently connected
otherwise it will disconnect.
Expand Down Expand Up @@ -1588,7 +1588,7 @@ async def _process_msg(
if hdr:
ctrl_msg = self._is_control_message(data, hdr)

# Check if the hearbeat has a "Consumer Stalled" header, if
# Check if the heartbeat has a "Consumer Stalled" header, if
# so, the value is the FC reply to send a nil message to.
# We will send it at the end of this function.
if ctrl_msg and ctrl_msg.startswith("Idle"):
Expand Down
2 changes: 1 addition & 1 deletion nats/js/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ def header(self) -> Optional[dict]:
@dataclass
class KeyValueConfig(Base):
"""
KeyValueConfig is the configurigation of a KeyValue store.
KeyValueConfig is the configuration of a KeyValue store.
"""
bucket: str
description: Optional[str] = None
Expand Down
10 changes: 5 additions & 5 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ async def subscription_handler(msg):
await nc.publish("foo", b'C')
await nc.publish("foo", b'D')

# Ordering should be preserverd in these at least
# Ordering should be preserved in these at least
self.assertEqual(b'A', msgs[0].data)
self.assertEqual(b'B', msgs[1].data)

Expand Down Expand Up @@ -1117,7 +1117,7 @@ async def err_cb(e):
await asyncio.sleep(0.2)
await asyncio.sleep(0)

# Many attempts but only at most 2 reconnects would have occured,
# Many attempts but only at most 2 reconnects would have occurred,
# in case it was able to reconnect to another server while it was
# shutting down.
self.assertTrue(nc.stats['reconnects'] >= 1)
Expand Down Expand Up @@ -1207,7 +1207,7 @@ async def err_cb(e):
await asyncio.sleep(0.1)
await asyncio.sleep(0)

# Only reconnected succesfully once to the same server.
# Only reconnected successfully once to the same server.
self.assertTrue(nc.stats['reconnects'] == 1)
self.assertEqual(1, len(nc._server_pool))

Expand Down Expand Up @@ -1580,7 +1580,7 @@ async def worker_handler(msg):
self.assertIn('auth_required', nc._server_info)
self.assertTrue(nc.is_connected)

# Trigger a reconnnect
# Trigger a reconnect
await asyncio.get_running_loop().run_in_executor(
None, self.server_pool[0].stop
)
Expand Down Expand Up @@ -1727,7 +1727,7 @@ async def worker_handler(msg):
response = await nc.request("example", b'Help!', timeout=1)
self.assertEqual(b'Reply:1', response.data)

# Trigger a reconnnect and should be fine
# Trigger a reconnect and should be fine
await asyncio.get_running_loop().run_in_executor(
None, self.server_pool[0].stop
)
Expand Down