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

Async Sources #281

Open
Max-Meldrum opened this issue Oct 28, 2021 · 0 comments
Open

Async Sources #281

Max-Meldrum opened this issue Oct 28, 2021 · 0 comments
Labels
Discussion proposal Design proposal for Arcon

Comments

@Max-Meldrum
Copy link
Member

As of now, source polling is not async.

pub trait Source: Send + 'static {
    type Item: ArconType;
    /// Poll Source for an Item
    fn poll_next(&mut self) -> SourceResult<Poll<Self::Item>>;
    /// Set offset for the source
    ///
    /// May be used by replayable sources to set a certain offset..
    fn set_offset(&mut self, offset: usize);
}

My guess is that most sources that we and others implement will be async/await in Rust.

By having it async and using cooperative scheduling on a single core between a Source and operator(s), we will utilise the CPU much better compared to a blocking approach.

Related to #277

@Max-Meldrum Max-Meldrum added Discussion proposal Design proposal for Arcon labels Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion proposal Design proposal for Arcon
Projects
None yet
Development

No branches or pull requests

1 participant