pub fn worker(&self, notify: impl Fn() + Send + Sync + 'static) -> Worker {
        let mut shards = self.global.shards.write().unwrap();
        let vacant = shards.vacant_entry();

        // Create a worker and put its stealer handle into the executor.
        let worker = Worker {
            key: vacant.key(),
            global: Arc::new(self.global.clone()),
            shard: Arc::new(ConcurrentQueue::bounded(512)),
            local: Arc::new(ConcurrentQueue::unbounded()),
            callback: Callback::new(notify),
            sleeping: Cell::new(false),
            ticker: Cell::new(0),
            _marker: PhantomData,
        };
        vacant.insert(worker.shard.clone());

        worker
    }
/// Registers a new worker.
///
/// The worker will automatically deregister itself when dropped.
Registers a new worker.
The worker will automatically deregister itself when dropped.
Registers a new worker . The worker will automatically deregister itself when dropped .
pub fn worker(&self, notify: impl Fn() + Send + Sync + 'static) -> Worker {
        let mut shards = self.global.shards.write().unwrap();
        let vacant = shards.vacant_entry();
        // Create a worker and put its stealer handle into the executor.
        let worker = Worker {
            key: vacant.key(),
            global: Arc::new(self.global.clone()),
            shard: Arc::new(ConcurrentQueue::bounded(512)),
            local: Arc::new(ConcurrentQueue::unbounded()),
            callback: Callback::new(notify),
            sleeping: Cell::new(false),
            ticker: Cell::new(0),
            _marker: PhantomData,
        };
        vacant.insert(worker.shard.clone());
        worker
    }
pub fn worker ( & self , notify : impl Fn ( ) + Send + Sync + ' static ) -> Worker { let mut shards = self . global . shards . write ( ) . unwrap ( ) ; let vacant = shards . vacant_entry ( ) ; // Create a worker and put its stealer handle into the executor. let worker = Worker { key : vacant . key ( ) , global : Arc :: new ( self . global . clone ( ) ) , shard : Arc :: new ( ConcurrentQueue :: bounded ( 512 ) ) , local : Arc :: new ( ConcurrentQueue :: unbounded ( ) ) , callback : Callback :: new ( notify ) , sleeping : Cell :: new ( false ) , ticker : Cell :: new ( 0 ) , _marker : PhantomData , } ; vacant . insert ( worker . shard . clone ( ) ) ; worker }
Registers a new worker.
Registers a new worker .
&self
notify
impl Fn() + Send + Sync + 'static