Skip to content

Commit

Permalink
Document the cloning behavior for Batch (#643)
Browse files Browse the repository at this point in the history
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
  • Loading branch information
marmistrz and tomusdrw committed Jun 2, 2023
1 parent da2a0a3 commit b4095d2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/transports/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ type Pending = oneshot::Sender<error::Result<rpc::Value>>;
type PendingRequests = Arc<Mutex<BTreeMap<RequestId, Pending>>>;

/// Transport allowing to batch queries together.
///
/// Note: cloned instances of [Batch] share the queues of pending and unsent requests.
/// If you want to avoid it, use [Batch::new] repeatedly instead.
#[derive(Debug, Clone)]
pub struct Batch<T> {
transport: T,
Expand Down

0 comments on commit b4095d2

Please sign in to comment.