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

Adding "seq" kwargs to events, this fixes #4 #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

clayrichardson
Copy link
Contributor

Another option would be to not overload the handler, but that requires more modification.

From: https://poloniex.com/support/api/
"""
The dictionary portion of each market message ("kwargs" in the Node.js example) will contain a sequence number with the key "seq". In order to keep your order book consistent, you will need to ensure that messages are applied in the order of their sequence numbers, even if they arrive out of order. In some markets, if there is no update for more than 1 second, a heartbeat message consisting of an empty argument list and the latest sequence number will be sent. These will go out once per second, but if there is no update for more than 60 seconds, the heartbeat interval will be reduced to 8 seconds until the next update.

Several order book and trade history updates will often arrive in a single message. Be sure to loop through the entire array, otherwise you will miss some updates.
"""
Pulled from var currencyPairArray on https://poloniex.com/exchange
Current as of Sun May 7 07:11:23 UTC 2017
@@ -47,9 +47,10 @@ def ticker_wrapper(handler):


def trades_wrapper(topic, handler):
async def decorator(data):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@clayrichardson Will other handlers work in this case?

@andrewshvv
Copy link
Member

andrewshvv commented May 7, 2017

Issue: #4 , #7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants