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

add new option autoStart. #3775

Merged
merged 10 commits into from
Apr 28, 2022
Merged

add new option autoStart. #3775

merged 10 commits into from
Apr 28, 2022

Conversation

mmouterde
Copy link
Contributor

@mmouterde mmouterde commented Apr 26, 2022

This PR contains:

  • A NEW FEATURE PROPOSAL

Describe the problem you have without this PR

replicateRxCollection() provides a way to configure the way to replicate a given collection.
However, by default, this function also run an initial replication as side effect.

IMHO, it's a matter of separation of concerns:

The moment to configure collections and replications is not always the same we get ready to do the first replication.
I would like to trigger replications collection by collection and keep control on the order, the timing... and separately from the replication definition.

I suggest to add an option to prevent the default first replication and separate the replication configuration and triggering.

This PR adds new option runInitialReplication.
It could be set to false to avoid initialReplication on replicateRxCollection().
default to true to avoid breaking change

Please consider this PR as a draft and support for discussions.
I know this issue is an opinionated one, feel free to challenge it ;)

 Could be set to `false` to avoid  initialReplication on replicateRxCollection().

default to true to avoid breaking change.
In this case, the first run() starts the polling loop.
It was always false positive as changing liveInterval to >0 had no effect, and that is the purpose of the tests.

Now, we insert document, that triggers a push and we get a proof properly.
@mmouterde mmouterde changed the title Patch 6 add new option autoStart. Apr 26, 2022
@pubkey pubkey merged commit 6a16aa5 into pubkey:master Apr 28, 2022
pubkey added a commit that referenced this pull request Apr 28, 2022
@pubkey
Copy link
Owner

pubkey commented Apr 28, 2022

Merged, thank you very much.

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