Trait timely::worker::AsWorker

source ·
pub trait AsWorker: Scheduler {
    // Required methods
    fn config(&self) -> &Config;
    fn index(&self) -> usize;
    fn peers(&self) -> usize;
    fn allocate<T: Exchangeable>(
        &mut self,
        identifier: usize,
        address: Rc<[usize]>,
    ) -> (Vec<Box<dyn Push<T>>>, Box<dyn Pull<T>>);
    fn pipeline<T: 'static>(
        &mut self,
        identifier: usize,
        address: Rc<[usize]>,
    ) -> (ThreadPusher<T>, ThreadPuller<T>);
    fn new_identifier(&mut self) -> usize;
    fn peek_identifier(&self) -> usize;
    fn log_register(&self) -> RefMut<'_, Registry>;

    // Provided method
    fn logging(&self) -> Option<TimelyLogger> { ... }
}
Expand description

Methods provided by the root Worker.

These methods are often proxied by child scopes, and this trait provides access.

Required Methods§

source

fn config(&self) -> &Config

Returns the worker configuration parameters.

source

fn index(&self) -> usize

Index of the worker among its peers.

source

fn peers(&self) -> usize

Number of peer workers.

source

fn allocate<T: Exchangeable>( &mut self, identifier: usize, address: Rc<[usize]>, ) -> (Vec<Box<dyn Push<T>>>, Box<dyn Pull<T>>)

Allocates a new channel from a supplied identifier and address.

The identifier is used to identify the underlying channel and route its data. It should be distinct from other identifiers passed used for allocation, but can otherwise be arbitrary.

The address should specify a path to an operator that should be scheduled in response to the receipt of records on the channel. Most commonly, this would be the address of the target of the channel.

source

fn pipeline<T: 'static>( &mut self, identifier: usize, address: Rc<[usize]>, ) -> (ThreadPusher<T>, ThreadPuller<T>)

Constructs a pipeline channel from the worker to itself.

By default this method uses the native channel allocation mechanism, but the expectation is that this behavior will be overridden to be more efficient.

source

fn new_identifier(&mut self) -> usize

Allocates a new worker-unique identifier.

source

fn peek_identifier(&self) -> usize

The next worker-unique identifier to be allocated.

source

fn log_register(&self) -> RefMut<'_, Registry>

Provides access to named logging streams.

Provided Methods§

source

fn logging(&self) -> Option<TimelyLogger>

Provides access to the timely logging stream.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<A: Allocate> AsWorker for Worker<A>

source§

impl<G, T> AsWorker for Child<'_, G, T>