Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Rework Buffer block#36

Closed
imunproductive wants to merge 6 commits intoartob:masterfrom
imunproductive:fix/buffer
Closed

Rework Buffer block#36
imunproductive wants to merge 6 commits intoartob:masterfrom
imunproductive:fix/buffer

Conversation

@imunproductive
Copy link
Contributor

@imunproductive imunproductive commented Dec 19, 2024

This PR reworks current Buffer block. It adds another input to act as a trigger to output already stored messages received in main input port.

Here is the simplest example that would buffer a string and then output it each time ReadStdin block outputs anything (on new line).

use protoflow_blocks::*;
fn main() {
	System::run(|s| {
		let stdin = s.read_stdin();
		let hello = s.const_string("Hello, World!");
		let encode = s.encode_lines();
		let buffer = s.buffer();
		let stdout = s.write_stdout();
		s.connect(&hello.output, &encode.input);
		s.connect(&encode.output, &buffer.input);
		s.connect(&stdin.output, &buffer.trigger);
		s.connect(&buffer.output, &stdout.input);
	});
}

I am not sure what to do with StdioSystem implementation so for now I left it as it was before, meaning it just eats input and outputs nothing.

@imunproductive imunproductive added the enhancement New feature or request label Dec 19, 2024
@imunproductive imunproductive mentioned this pull request Dec 19, 2024
@artob
Copy link
Owner

artob commented Jan 27, 2025

@race-of-sloths invite

@race-of-sloths
Copy link

race-of-sloths commented Jan 27, 2025

@imunproductive Thank you for your contribution! Your pull request is now a part of the Race of Sloths!
We are launching a survey "Who is faster? You vs SpaceX"

Shows inviting banner with latest news.

Shows profile picture for the author of the PR

Current status: stale

This pull request was removed from the race, but you can include it again with @race-of-sloths include command

What is the Race of Sloths

Race of Sloths is a friendly competition where you can participate in challenges and compete with other open-source contributors within your normal workflow

For contributors:

  • Tag @race-of-sloths inside your pull requests
  • Wait for the maintainer to review and score your pull request
  • Check out your position in the Leaderboard
  • Keep weekly and monthly streaks to reach higher positions
  • Boast your contributions with a dynamic picture of your Profile

For maintainers:

  • Score pull requests that participate in the Race of Sloths and receive a reward
  • Engage contributors with fair scoring and fast responses so they keep their streaks
  • Promote the Race to the point where the Race starts promoting you
  • Grow the community of your contributors

Feel free to check our website for additional details!

Bot commands
  • For contributors
    • Include a PR: @race-of-sloths include to enter the Race with your PR
  • For maintainers:
    • Invite contributor @race-of-sloths invite to invite the contributor to participate in a race or include it, if it's already a runner.
    • Assign points: @race-of-sloths score [1/2/3/5/8/13] to award points based on your assessment.
    • Reject this PR: @race-of-sloths exclude to send this PR back to the drawing board.
    • Exclude repo: @race-of-sloths pause to stop bot activity in this repo until @race-of-sloths unpause command is called

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ CI failed

Platform Name Status Details
All Formatting Details
Linux Build library Details
Linux Build binaries Details
Linux Build tests Details
Linux Build examples Details
Linux Run tests Details
Linux Run doctests Details

@artob
Copy link
Owner

artob commented Jan 22, 2026

@race-of-sloths score 8

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ CI failed

Platform Name Status Details
All Formatting Details
Linux Build library Details
Linux Build binaries Details
Linux Build tests Details
Linux Build examples Details
Linux Run tests Details
Linux Run doctests Details

@artob
Copy link
Owner

artob commented Jan 22, 2026

Important

Protoflow has been discontinued and archived in favor of its successors Async-Flow and Flows.rs, which represent the future of flow-based programming in Rust and offer a substantially better developer experience as well as simply higher development velocity. We aim to eventually port the functionality in this pull request over to Flows.rs; if you'd like to contribute to make that happen sooner, please raise an issue and/or pull request against that repository.

@artob artob closed this Jan 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants