Skip to content

Commit

Permalink
Merge branch 'dependabot/pip/py-1.10.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
wallyqs committed Jul 13, 2021
2 parents 50034c9 + 83b5b6a commit f011db7
Show file tree
Hide file tree
Showing 4 changed files with 166 additions and 119 deletions.
159 changes: 102 additions & 57 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

101 changes: 51 additions & 50 deletions nats/aio/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@

class Subscription:
def __init__(
self,
subject='',
queue='',
future=None,
max_msgs=0,
is_async=False,
cb=None,
coro=None
self,
subject='',
queue='',
future=None,
max_msgs=0,
is_async=False,
cb=None,
coro=None
):
self.subject = subject
self.queue = queue
Expand Down Expand Up @@ -119,6 +119,7 @@ class Srv:
"""
Srv is a helper data structure to hold state of a server.
"""

def __init__(self, uri):
self.uri = uri
self.reconnects = 0
Expand Down Expand Up @@ -228,38 +229,38 @@ def __init__(self):
}

async def connect(
self,
servers=["nats://127.0.0.1:4222"],
io_loop=None,
loop=None,
error_cb=None,
disconnected_cb=None,
closed_cb=None,
discovered_server_cb=None,
reconnected_cb=None,
name=None,
pedantic=False,
verbose=False,
allow_reconnect=True,
connect_timeout=DEFAULT_CONNECT_TIMEOUT,
reconnect_time_wait=DEFAULT_RECONNECT_TIME_WAIT,
max_reconnect_attempts=DEFAULT_MAX_RECONNECT_ATTEMPTS,
ping_interval=DEFAULT_PING_INTERVAL,
max_outstanding_pings=DEFAULT_MAX_OUTSTANDING_PINGS,
dont_randomize=False,
flusher_queue_size=DEFAULT_MAX_FLUSHER_QUEUE_SIZE,
pending_size=DEFAULT_PENDING_SIZE,
no_echo=False,
tls=None,
tls_hostname=None,
user=None,
password=None,
token=None,
drain_timeout=DEFAULT_DRAIN_TIMEOUT,
signature_cb=None,
user_jwt_cb=None,
user_credentials=None,
nkeys_seed=None,
self,
servers=["nats://127.0.0.1:4222"],
io_loop=None,
loop=None,
error_cb=None,
disconnected_cb=None,
closed_cb=None,
discovered_server_cb=None,
reconnected_cb=None,
name=None,
pedantic=False,
verbose=False,
allow_reconnect=True,
connect_timeout=DEFAULT_CONNECT_TIMEOUT,
reconnect_time_wait=DEFAULT_RECONNECT_TIME_WAIT,
max_reconnect_attempts=DEFAULT_MAX_RECONNECT_ATTEMPTS,
ping_interval=DEFAULT_PING_INTERVAL,
max_outstanding_pings=DEFAULT_MAX_OUTSTANDING_PINGS,
dont_randomize=False,
flusher_queue_size=DEFAULT_MAX_FLUSHER_QUEUE_SIZE,
pending_size=DEFAULT_PENDING_SIZE,
no_echo=False,
tls=None,
tls_hostname=None,
user=None,
password=None,
token=None,
drain_timeout=DEFAULT_DRAIN_TIMEOUT,
signature_cb=None,
user_jwt_cb=None,
user_credentials=None,
nkeys_seed=None,
):
for cb in [error_cb, disconnected_cb, closed_cb, reconnected_cb,
discovered_server_cb]:
Expand Down Expand Up @@ -675,15 +676,15 @@ async def _publish(self, subject, reply, payload, payload_size):
await self._flush_pending()

async def subscribe(
self,
subject,
queue="",
cb=None,
future=None,
max_msgs=0,
is_async=False,
pending_msgs_limit=DEFAULT_SUB_PENDING_MSGS_LIMIT,
pending_bytes_limit=DEFAULT_SUB_PENDING_BYTES_LIMIT,
self,
subject,
queue="",
cb=None,
future=None,
max_msgs=0,
is_async=False,
pending_msgs_limit=DEFAULT_SUB_PENDING_MSGS_LIMIT,
pending_bytes_limit=DEFAULT_SUB_PENDING_BYTES_LIMIT,
):
"""
Takes a subject string and optional queue string to send a SUB cmd,
Expand Down Expand Up @@ -851,7 +852,7 @@ async def _subscribe(self, sub, ssid):
await self._flush_pending()

async def request(
self, subject, payload, timeout=0.5, expected=1, cb=None
self, subject, payload, timeout=0.5, expected=1, cb=None
):
"""
Implements the request/response pattern via pub/sub
Expand Down
1 change: 1 addition & 0 deletions nats/aio/nuid.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class NUID:
NUID is an implementation of the approach for fast generation of
unique identifiers used for inboxes in NATS.
"""

def __init__(self):
self._srand = SystemRandom()
self._prand = Random(self._srand.randint(0, MaxInt))
Expand Down
24 changes: 12 additions & 12 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@

class Gnatsd:
def __init__(
self,
port=4222,
user="",
password="",
token="",
timeout=0,
http_port=8222,
debug=False,
tls=False,
cluster_listen=None,
routes=[],
config_file=None,
self,
port=4222,
user="",
password="",
token="",
timeout=0,
http_port=8222,
debug=False,
tls=False,
cluster_listen=None,
routes=[],
config_file=None,
):
self.port = port
self.user = user
Expand Down

0 comments on commit f011db7

Please sign in to comment.