public T Enqueue <T>(T command) where T : CommandBase { _commands.Enqueue(command); Enqueued?.Invoke(this, new CommandRunnerEvent(command)); DispatchNext(); return(command); }
public bool TryEnqueue(TValue element) { lock (_sync) { if (_order.ContainsKey(element)) { return(false); } _order.Add(element, _counter++); _values.Add(element); } Enqueued?.Invoke(this, element); return(true); }
public bool TryEnqueue(T item, int timeout = System.Threading.Timeout.Infinite) { if (Monitor.TryEnter(q, timeout)) { try { q.Enqueue(item); Enqueued?.Invoke(this, EventArgs.Empty); } finally { Monitor.Exit(q); } return(true); } else { return(false); } }
public void Enqueue(T item) { queue.Enqueue(item); Enqueued?.Invoke(null, item); }
private void WakeProcessor() => Enqueued?.Invoke(this, EventArgs.Empty);
public virtual void Enqueue(T item) { queue.Enqueue(item); Enqueued?.Invoke(this, new ItemEventArgs <T>(item)); dequeueEvent.Set(); }
public override void OnEnqueue(MachineId machineId, string eventName) { base.OnEnqueue(machineId, eventName); Enqueued?.Invoke(machineId, eventName); }
public void OnEnqueued(object sender, PersonModel person, RoomModel room) { Enqueued?.Invoke(sender, new EnqueingEventArgs(person, room)); }
public void Enqueue(T directory) { Queue.Enqueue(directory); Enqueued?.Invoke(); }