/// <summary> /// Запускает завершение асинхронной операции, передавая на вход заершения входной освободитель итемов /// </summary> /// <param name="asyncOperationBeginAction">Действие, знаменующее завершение асинхронной операции</param> /// <param name="itemsReleaser">Освободитель итемов</param> private void RunActionWthAsyncTailBack(Action <IItemsReleaser <TAddressKey> > asyncOperationBeginAction, IItemsReleaser <TAddressKey> itemsReleaser) { try { asyncOperationBeginAction(itemsReleaser); } catch (Exception) { // TODO: do something with exception :-) // TODO: thats bad, cause items can be not released } }
public ItemReleaserRelayWithExecutionCountControl(IItemsReleaser <TKey> originalItemsReleaser) { _sync = new object(); _originalItemsReleaser = originalItemsReleaser; _someItemWasReleased = false; }
/// <summary> /// Runs ending of async operation giving queue items releaser to it /// </summary> /// <param name="asyncOperationBeginAction">Action that runs at the end of async operation</param> /// <param name="itemsReleaser">Items releaser</param> private void RunActionWithAsyncTailBack(Action <IItemsReleaser <TAddressKey> > asyncOperationBeginAction, IItemsReleaser <TAddressKey> itemsReleaser) { try { _totalFlowCounter.IncrementCount(); _debugLogger.Log("_totalFlowCounter.Count = " + _totalFlowCounter.Count); asyncOperationBeginAction(itemsReleaser); } catch (Exception ex) { _debugLogger.Log(ex); } }