diff --git a/channels/src/sender.rs b/channels/src/sender.rs index d8df2fc..cb3feae 100644 --- a/channels/src/sender.rs +++ b/channels/src/sender.rs @@ -275,7 +275,14 @@ where where D: Borrow, { - let payload = self.serialize_t(data.borrow())?; + self._send(data.borrow()).await + } + + async fn _send( + &mut self, + data: &T, + ) -> Result<(), SendError> { + let payload = self.serialize_t(data)?; crate::protocol::send_async( &self.config, @@ -324,7 +331,14 @@ where where D: Borrow, { - let payload = self.serialize_t(data.borrow())?; + self._send_blocking(data.borrow()) + } + + fn _send_blocking( + &mut self, + data: &T, + ) -> Result<(), SendError> { + let payload = self.serialize_t(data)?; crate::protocol::send_sync( &self.config,