Skip to content

Commit

Permalink
Bump minimum pipe capacity to 1
Browse files Browse the repository at this point in the history
0 causes a runtime error:

  The application panicked (crashed).
  Message:  capacity is empty
  Location: robotica-backend/src/pipes/stateful/receiver.rs:269

  Backtrace omitted.

  Run with RUST_BACKTRACE=1 environment variable to display it.
  Run with RUST_BACKTRACE=full to include source snippets.
  • Loading branch information
brianmay committed Sep 10, 2023
1 parent 800370d commit caba592
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion robotica-backend/src/pipes/stateful/receiver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ where
{
/// Create a null subscription that is already closed.
fn null(tx: mpsc::Sender<ReceiveMessage<T>>) -> Self {
let (_tx, rx) = broadcast::channel(0);
let (_tx, rx) = broadcast::channel(1);
Self {
rx,
_tx: tx,
Expand Down
2 changes: 1 addition & 1 deletion robotica-backend/src/pipes/stateless/receiver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ where
{
/// Create a null subscription that is already closed.
fn null(tx: mpsc::Sender<ReceiveMessage<T>>) -> Self {
let (_tx, rx) = broadcast::channel(0);
let (_tx, rx) = broadcast::channel(1);
Self { rx, _tx: tx }
}
}
Expand Down

0 comments on commit caba592

Please sign in to comment.