示例#1
0
        public async Task <ICommonQueueEndpointConsumeController> Consume(CommonQueueConsumeEndpoint endpoint, Func <CommonMessage, Task> messageHandle)
        {
            CommonQueueEndpointConsumeControllerWrapper wrapper = null;

            if (!_start.Value)
            {
                var service    = getService(endpoint.QueueType);
                var controller = await service.Consume(endpoint, endpoint.QueueConfiguration, messageHandle);

                if (controller != null)
                {
                    _start.Value = true;
                    wrapper      = new CommonQueueEndpointConsumeControllerWrapper(controller, _start);
                }
            }

            return(wrapper);
        }
示例#2
0
 public async Task Update(CommonQueueConsumeEndpoint endpoint)
 {
     await _commonQueueConsumeEndpointStore.Update(endpoint);
 }
示例#3
0
 public async Task Delete(CommonQueueConsumeEndpoint endpoint)
 {
     await _commonQueueConsumeEndpointStore.Delete(endpoint.ID);
 }
示例#4
0
 public async Task Add(CommonQueueConsumeEndpoint endpoint)
 {
     await _commonQueueConsumeEndpointStore.Add(endpoint);
 }