MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / button

Function button

src/timely-util/src/builder_async.rs:726–747  ·  view source on GitHub ↗

Creates a new coordinated button the worker configuration described by `scope`.

(
    scope: Scope<'scope, T>,
    addr: Rc<[usize]>,
)

Source from the content-addressed store, hash-verified

724
725/// Creates a new coordinated button the worker configuration described by `scope`.
726pub fn button<'scope, T: Timestamp>(
727 scope: Scope<'scope, T>,
728 addr: Rc<[usize]>,
729) -> (ButtonHandle, Button) {
730 let index = scope.worker().new_identifier();
731 let (pushers, puller) = scope.worker().allocate(index, addr);
732
733 let local_pressed = Rc::new(Cell::new(false));
734
735 let handle = ButtonHandle {
736 buttons_remaining: scope.peers(),
737 local_pressed: Rc::clone(&local_pressed),
738 puller,
739 };
740
741 let token = Button {
742 pushers,
743 local_pressed,
744 };
745
746 (handle, token)
747}
748
749/// A button that can be used to coordinate an action after all workers have pressed it.
750pub struct ButtonHandle {

Callers 3

txns_progress_frontiersFunction · 0.85
newMethod · 0.85

Calls 3

cloneFunction · 0.85
new_identifierMethod · 0.80
allocateMethod · 0.80

Tested by

no test coverage detected