/// <inheritdoc /> public Task RegisterActionAsync <TState>(LogicLooperActionWithStateDelegate <TState> loopAction, TState state) { var action = new LogicLooper.LooperAction(LogicLooper.DelegateHelper.GetWrapper <TState>(), loopAction, state); lock (_actions) { _actions.Add(action); } return(action.Future.Task); }
/// <inheritdoc /> public Task RegisterActionAsync <TState>(LogicLooperActionWithStateDelegate <TState> loopAction, TState state) => _balancer.GetPooledLooper(_loopers).RegisterActionAsync(loopAction, state);
public Task RegisterActionAsync <TState>(LogicLooperActionWithStateDelegate <TState> loopAction, TState state) => throw new InvalidOperationException("LogicLooper.Shared is not initialized yet.");
/// <summary> /// Registers a loop-frame action with state object to the looper and returns <see cref="Task"/> to wait for completion. /// </summary> /// <param name="loopAction"></param> /// <param name="state"></param> /// <returns></returns> public Task RegisterActionAsync <TState>(LogicLooperActionWithStateDelegate <TState> loopAction, TState state) { var action = new LooperAction(DelegateHelper.GetWrapper <TState>(), loopAction, state); return(RegisterActionAsyncCore(action)); }
/// <inheritdoc /> public Task RegisterActionAsync <TState>(LogicLooperActionWithStateDelegate <TState> loopAction, TState state) { return(Loopers[0].RegisterActionAsync(loopAction, state)); }