Skip to content

Commit

Permalink
Add kwargs for the callback function
Browse files Browse the repository at this point in the history
  • Loading branch information
axelfahy committed Jul 18, 2020
1 parent 1a60c79 commit e93642e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ogn/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def disconnect(self):

self._kill = True

def run(self, callback, timed_callback=lambda client: None, autoreconnect=False):
def run(self, callback, timed_callback=lambda client: None, autoreconnect=False, **kwargs):
while not self._kill:
try:
keepalive_time = time()
Expand All @@ -72,7 +72,7 @@ def run(self, callback, timed_callback=lambda client: None, autoreconnect=False)
self.logger.warning('Read returns zero length string. Failure. Orderly closeout')
break

callback(packet_str)
callback(packet_str, **kwargs)
except ConnectionError:
self.logger.error('ConnectionError', exc_info=True)
except socket.error:
Expand Down

0 comments on commit e93642e

Please sign in to comment.