Skip to content

Commit 42b9e89

Browse files
authored
Merge pull request #158 from AlexanderRayCarlson/patch-1
Marked event handlers async
2 parents 41340d8 + d2b8ac8 commit 42b9e89

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ if `AM.*` given to the `subscribe()` method, a WebSocket connection is
191191
established to Polygon's interface.
192192

193193
The `run` method is a short-cut to start subscribing to channels and
194-
runnnig forever. The call will be blocked forever until a critical
194+
running forever. The call will be blocked forever until a critical
195195
exception is raised, and each event handler is called asynchronously
196196
upon the message arrivals.
197197

@@ -215,15 +215,15 @@ async def on_account_updates(conn, channel, account):
215215
print('account', account)
216216

217217
@conn.on(r'^status$')
218-
def on_status(conn, channel, data):
218+
async def on_status(conn, channel, data):
219219
print('polygon status update', data)
220220

221221
@conn.on(r'^AM$')
222-
def on_minute_bars(conn, channel, bar):
222+
async def on_minute_bars(conn, channel, bar):
223223
print('bars', bar)
224224

225225
@conn.on(r'^A$')
226-
def on_second_bars(conn, channel, bar):
226+
async def on_second_bars(conn, channel, bar):
227227
print('bars', bar)
228228

229229
# blocks forever

0 commit comments

Comments
 (0)