pub fn build_wal_entry_distributor_and_receivers(
provider: Provider,
raw_wal_reader: Arc<dyn RawEntryReader>,
region_ids: &[RegionId],
buffer_size: usize,
) -> (WalEntryDistributor, Vec<WalEntryReceiver>)
Expand description
Returns WalEntryDistributor and batch WalEntryReceivers.
ยงNote:
Ensures receiver.read
is called before the distributor.distribute
in the same thread.
let (distributor, receivers) = build_wal_entry_distributor_and_receivers(..);
Thread 1 |
|
// may deadlock |
distributor.distribute().await; |
|
|
receivers[0].read().await |