public void Add(DispatcherSubscription subscription)
        {
            if (!_subscriptions.ContainsKey(subscription.MessageType))
            {
                _subscriptions[subscription.MessageType] =
                    new SortedSet<DispatcherSubscription>(
                        Comparer<DispatcherSubscription>.Create((d1, d2) => d1.Priority.CompareTo(d2.Priority))); //todo static?
            }

            _subscriptions[subscription.MessageType].Add(subscription);
        }
        internal ContextExecutor GetExecutor(DispatcherSubscription subscription)
        {
            //todo cache

            HandlerExecutor func = CreateExecutorDelegate(
                    subscription.HandlerType,
                    subscription.Action,
                    subscription.MessageType);

            bool isTaskResult = subscription.Action.IsAsync();
            var executor = new ContextExecutor(func, isTaskResult); //todo
            return executor;
        }
        public bool Remove(DispatcherSubscription subscription)
        {
            if (Exists(subscription))
            {
                return true;
            }

            return false;
        }
 public bool Exists(DispatcherSubscription subscription)
 {
     return false;
 }