protected void EventHandler(IEventInfo e) { if (_IsCompleted) { return; } // Events that don't match are silently rejected. // FIXME: Is this actually horrible if (!TryExtractResult(e, out Result)) { return; } e.Consume(); _IsCompleted = true; Dispose(); if (Continuation != null) { Continuation(); } if (_Future != null) { _Future.SetResult(Result, null); } }
protected abstract bool TryExtractResult(IEventInfo e, out T result);