SeaQL / sea-streamer

🌊 A real-time stream processing toolkit for Rust
https://www.sea-ql.org/SeaStreamer/
Apache License 2.0
238 stars 7 forks source link

feat: from url and from iterator for streameruri #28

Closed carlocorradini closed 1 month ago

carlocorradini commented 1 month ago

PR Info

Added From<Url> and FromIterator<Url> for StreamerUri.

New Features

carlocorradini commented 1 month ago

Unfortunately the following does not compile due to Send (it is required?)

fn connect(
        streamer: impl Into<StreamerUri>,
        options: Self::ConnectOptions,
) -> impl Future<Output = StreamResult<Self, Self::Error>> + Send;
tyt2y3 commented 1 month ago

it is possible, if we add Send as a trait bound?

fn connect<S>(
        streamer: S,
        options: Self::ConnectOptions,
) -> impl Future<Output = StreamResult<Self, Self::Error>> + Send
where S: Into<StreamerUri> + Send, {}
carlocorradini commented 1 month ago

Done 🥳

tyt2y3 commented 1 month ago

Sad, there was a bunch of errors, where type inference fails.

carlocorradini commented 1 month ago

I'll fix it ASAP. Sadness... I've run cargo build --all --all-features (same for test) and it worked.

tyt2y3 commented 1 month ago

It can be reproduced by cargo test --no-run. May be we change to parse::< StreamerUri >() in all cases

carlocorradini commented 1 month ago

Done 🥳