Skip to content
This repository has been archived by the owner on Feb 19, 2020. It is now read-only.

Add an example showing up how to be in sync on reconnection #17

Closed
maoueh opened this issue Nov 15, 2018 · 0 comments
Closed

Add an example showing up how to be in sync on reconnection #17

maoueh opened this issue Nov 15, 2018 · 0 comments

Comments

@maoueh
Copy link
Contributor

maoueh commented Nov 15, 2018

The ultimate goal of the library is to automatically handle the syncing case when reconnecting in the near future.

Right now, this needs to be implemented at the consumer level. A full example showing this would be required so we can quickly point users to it so they can handle it correctly in there own code.

This means:

  1. Having an initial undefined start_block on initial connection
  2. Having a with_progress flag and record the last seen block
  3. On reconnection, re-listen automatically setting start_block to last block seen.

Caveats/To deal with:

  1. Most API tokens have access to only -3600 block in the past, we should probably handle that correctly.
  2. Explain that in production, last block seen would need to be persisted somehow so that a full crash of the process can recover gracefully to a correct start_block
@maoueh maoueh closed this as completed Feb 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant