-
-
Notifications
You must be signed in to change notification settings - Fork 68
feat(engineio-client): wip Stream
+ Sink
based client implementation
#555
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
base: main
Are you sure you want to change the base?
Conversation
Stream
+ Sink
based client implementation
self.tx.try_send(packets) | ||
} | ||
|
||
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> { |
Check warning
Code scanning / clippy
unused variable: cx Warning
Poll::Ready(Ok(())) | ||
} | ||
|
||
fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> { |
Check warning
Code scanning / clippy
unused variable: cx Warning
} | ||
} | ||
|
||
fn start_send(self: Pin<&mut Self>, item: Packet) -> Result<(), Self::Error> { |
Check warning
Code scanning / clippy
unused variable: item Warning
#[cfg(feature = "tracing")] | ||
tracing::trace!(post_state = ?self.post_state, "sending packet"); | ||
|
||
let body = match &self.post_state { |
Check warning
Code scanning / clippy
unused variable: body Warning
} | ||
PostState::Pending { ref mut fut } => { | ||
match poll!(unsafe { Pin::new_unchecked(fut) }.poll(cx)) { | ||
Ok(res) => { |
Check warning
Code scanning / clippy
unused variable: res Warning
} | ||
|
||
impl<F> PollState<F> { | ||
fn get_decoding(self) -> Pin<Box<dyn Stream<Item = Result<Packet, PacketParseError>>>> { |
Check warning
Code scanning / clippy
method get_decoding is never used Warning
@@ -0,0 +1,85 @@ | |||
use std::str::FromStr; |
Check warning
Code scanning / clippy
unused import: std::str::FromStr Warning test
use engineioxide::{DisconnectReason, service::EngineIoService}; | ||
use engineioxide::{Socket, Str}; | ||
use engineioxide_client::{Client, HttpClient}; | ||
use engineioxide_core::{Packet, Sid}; |
Check warning
Code scanning / clippy
unused import: Packet Warning test
use engineioxide::{Socket, Str}; | ||
use engineioxide_client::{Client, HttpClient}; | ||
use engineioxide_core::{Packet, Sid}; | ||
use futures_util::{StreamExt, TryFutureExt}; |
Check warning
Code scanning / clippy
unused import: TryFutureExt Warning test
let svc = EngineIoService::new(Arc::new(handler)); | ||
let client = Client::connect(svc).await.unwrap(); | ||
assert_eq!(rx.recv().await.unwrap(), Event::Connect(client.sid)); | ||
let (ctx, mut crx) = client.split(); |
Check failure
Code scanning / clippy
type annotations needed Error test
No description provided.