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

Implement new merging and repeating transforms #703

Merged
merged 6 commits into from
Jun 16, 2024
Merged

Conversation

mairas
Copy link
Collaborator

@mairas mairas commented Jun 6, 2024

Merging transforms take multiple producer inputs and merge them into a tuple that can be passed for processing. Join emits an output whenever any input is updated, as long as all inputs are below max_age. Zip, on the other hand, emits an output once all inputs have been updated, also observing the age of individual inputs.

Repeating transforms keep emitting the input value at given intervals. Repeat emits whenever an input is received and keeps repeating the value every interval milliseconds. RepeatStopping works like Repeat but includes a max_age. If no input is received within max_age milliseconds, it stops repeating. RepeatExpring works like RepeatStopping, but instead of stopping altogether, it continues repeating expired_value once max_age is reached. And finally, RepeatConstantRate works like RepeatExpiring, but always emits at regular intervals, regardless of when new input as been received.

This make connect_to and O(N) operation with respect to the
number of existing observers, but the call order of the observers
is now the same as the insertion order. Also, adding new observers
usually happens in the setup stage of program execution, in which
the added performance penalty is not relevant.
Throttle limits the update rate of its input.
@mairas
Copy link
Collaborator Author

mairas commented Jun 6, 2024

I also added a Throttle transform that limits the input rate. Kinda similar to RepeatConstantRate but emits immediately and without the repetition.

@mairas mairas merged commit a48c188 into dev-3 Jun 16, 2024
28 checks passed
@mairas mairas deleted the new_transforms branch June 16, 2024 17:13
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.

1 participant