Exemplo n.º 1
0
        public void AddTrigger(long id, Type valueType)
        {
            var taskCompletionSource = TaskCompletionSourceAccessor.Create(valueType);

            lock (_triggers)
            {
                _triggers.Add(id, taskCompletionSource);
            }
        }
Exemplo n.º 2
0
        public object Compose(IValueContainer container, Type valueType)
        {
            var values = (TaskCompletionSourceContainer)container;

            if (values.Task == null) // must not be NULL!
            {
                return(TaskCompletionSourceAccessor.Create(typeof(object)));
            }

            var taskCompletionSource = TaskCompletionSourceAccessor.Create(values.Task);

            _taskCompletionSourceRegistry.Monitor(taskCompletionSource);
            return(taskCompletionSource);
        }