コード例 #1
0
ファイル: MessagingFactory.cs プロジェクト: Royal-Jay/Zombus
 public MessagingFactory(ConcurrentHandlerLimitSetting concurrentHandlerLimit, IZombusLogger logger, PrefetchCountSetting prefetchCount, IQueueManager queueManager)
 {
     _queueManager = queueManager;
     _concurrentHandlerLimit = concurrentHandlerLimit;
     _logger = logger;
     _prefetchCount = prefetchCount;
 }
コード例 #2
0
        public ActivityController(IActivityRepository activityRepository, IQueueManager queue, IConfiguration configuration, ITelemetryRepository telemetryRepository)
        {
            _activityRepository  = activityRepository;
            _storage             = queue;
            _configuration       = configuration;
            _telemetryRepository = telemetryRepository;

            userId = 1;

            /*
             * try
             * {
             *  userId = 1; //Convert.ToInt32(Request.Cookies["user"]);
             *  authKey = "test"; //Request.Cookies["authKey"];
             * }
             * catch (NullReferenceException)
             * {
             *  throw new HttpResponseException(HttpStatusCode.Unauthorized);
             * }
             * if (userId == 0) // TEMP, should return json
             * {
             *  throw new HttpResponseException(HttpStatusCode.Unauthorized);
             * }
             * if (authKey != UserAuth.Get(userId)) // TEMP, should return json
             * {
             *  throw new HttpResponseException(HttpStatusCode.Unauthorized);
             * }*/
        }
コード例 #3
0
 public ServerManager(ServerParameters parameters)
 {
     _taskScheduler = GetTaskScheduler(parameters.SchedulerType);
     _tasksFilePath = parameters.TasksFilePath;
     _timer         = GetTimer();
     _queueManager  = GetQueueManager();
 }
コード例 #4
0
ファイル: CrawlerThread.cs プロジェクト: windtwf/Myrepos
        private static void DoWork(object data)
        {
            CrawlerThread crawler    = (CrawlerThread)data;
            Downloader    downloader = crawler.m_downloader;
            IQueueManager queue      = downloader.UrlsQueueFrontier;

            while (true)
            {
                crawler.m_suspendEvent.WaitOne(Timeout.Infinite);

                if (queue.Count > 0)
                {
                    try
                    {
                        // 从队列中获取URL
                        string url = (string)queue.Dequeue();

                        // 获取页面
                        Fetch(crawler, url);
                        // TODO: 检测是否完成
                        //if (false) break;
                    }
                    catch (InvalidOperationException)
                    {
                        SleepWhenQueueIsEmpty(crawler);
                    }
                }
                else
                {
                    SleepWhenQueueIsEmpty(crawler);
                }
            }
        }
コード例 #5
0
        public NimbusQueueMessageSender(IQueueManager queueManager, string queuePath)
        {
            _queueManager = queueManager;
            _queuePath = queuePath;

            _queueClient = new Lazy<MessageSender>(() => _queueManager.CreateMessageSender(_queuePath));
        }
コード例 #6
0
        /// <summary>
        /// Constructor for the <see cref="OperationConfigurationsFacade"/>.
        /// </summary>
        /// <param name="context">Database context containing dashboard type entities.</param>
        /// <param name="blobManager">Manager for Azure Blob Storage.</param>
        /// <param name="queueManager">Manager for Azure Queue Storage.</param>
        /// <param name="documentDb">Azure DocumentDB repository</param>
        public OperationConfigurationsFacade(DataContext context, IBlobManager blobManager, IQueueManager queueManager,
                                             IDocumentDbRepository <UploadTransaction> documentDb)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }
            if (blobManager == null)
            {
                throw new ArgumentNullException(nameof(blobManager));
            }
            if (queueManager == null)
            {
                throw new ArgumentNullException(nameof(queueManager));
            }
            if (documentDb == null)
            {
                throw new ArgumentNullException(nameof(documentDb));
            }

            _blobStorageConnectionString = ConfigurationManager.ConnectionStrings["BlobProcessorStorageConnectionString"].ConnectionString;
            _blobStorageContainerName    = ConfigurationManager.AppSettings["BlobProcessorBlobStorageContainerName"];
            _queueStorageContainerName   = ConfigurationManager.AppSettings["BlobProcessorQueueStorageContainerName"];

            _context      = context;
            _blobManager  = blobManager;
            _queueManager = queueManager;
            _documentDb   = documentDb;
        }
コード例 #7
0
        public PurgeQueuesObserver(IQueueManager queueManager)
        {
            Guard.AgainstNull(queueManager, nameof(queueManager));

            _queueManager = queueManager;
            _log          = Log.For(this);
        }
コード例 #8
0
 public NimbusTopicMessageSender(IQueueManager queueManager, string topicPath, ILogger logger)
     : base()
 {
     _queueManager = queueManager;
     _topicPath    = topicPath;
     _logger       = logger;
 }
コード例 #9
0
 public NimbusSubscriptionMessageReceiver(IQueueManager queueManager, string topicPath, string subscriptionName, ConcurrentHandlerLimitSetting concurrentHandlerLimit)
 {
     _queueManager = queueManager;
     _topicPath = topicPath;
     _subscriptionName = subscriptionName;
     _concurrentHandlerLimit = concurrentHandlerLimit;
 }
コード例 #10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AsyncMessagePump"/> class.
        /// </summary>
        /// <param name="queueName">Name of the queue.</param>
        /// <param name="storageAccount">The cloud storage account.</param>
        /// <param name="concurrentTasks">The number of concurrent tasks.</param>
        /// <param name="visibilityTimeout">The visibility timeout.</param>
        /// <param name="maxDequeueCount">The maximum dequeue count.</param>
        /// <param name="metrics">The system where metrics are published</param>
        public AsyncMessagePump(string queueName, CloudStorageAccount storageAccount, int concurrentTasks = 25, TimeSpan?visibilityTimeout = null, int maxDequeueCount = 3, IMetrics metrics = null)
        {
            if (concurrentTasks < 1)
            {
                throw new ArgumentException("Number of concurrent tasks must be greather than zero", nameof(concurrentTasks));
            }
            if (maxDequeueCount < 1)
            {
                throw new ArgumentException("Number of retries must be greather than zero", nameof(maxDequeueCount));
            }

            _queueManager      = new QueueManager(queueName, storageAccount);
            _concurrentTasks   = concurrentTasks;
            _visibilityTimeout = visibilityTimeout;
            _maxDequeueCount   = maxDequeueCount;

            if (metrics == null)
            {
                var noop = new MetricsBuilder();
                noop.Configuration.Configure(new MetricsOptions()
                {
                    Enabled          = false,
                    ReportingEnabled = false
                });
                _metrics = noop.Build();
            }
            else
            {
                _metrics = metrics;
            }

            OnQueueEmpty = cancellationToken => Task.Delay(1500, cancellationToken).Wait();
            OnError      = (message, exception, isPoison) => _logger.ErrorException("An error occured when processing a message", exception);
        }
コード例 #11
0
ファイル: PerformanceMonitor.cs プロジェクト: BclEx/rhino-esb
 public PerformanceMonitor(IQueueManager queueManager)
 {
     _queueManager = queueManager;
     AssertCountersExist();
     AttachToEvents();
     SyncWithCurrentQueueState();
 }
コード例 #12
0
 public LightningQueuesChannel(Uri address, string queueName, IQueueManager queueManager, IDelayedMessageCache <MessageId> delayedMessages)
 {
     _address         = address;
     _queueName       = queueName;
     _queueManager    = queueManager;
     _delayedMessages = delayedMessages;
 }
コード例 #13
0
 public NimbusQueueMessageSender(IQueueManager queueManager, string queuePath, ILogger logger)
     : base()
 {
     _queueManager = queueManager;
     _queuePath    = queuePath;
     _logger       = logger;
 }
コード例 #14
0
 public ZombusQueueMessageSender(IQueueManager queueManager, string queuePath, IZombusLogger logger)
     : base()
 {
     _queueManager = queueManager;
     _queuePath = queuePath;
     _logger = logger;
 }
コード例 #15
0
 public BrokerController(IAuthenticationManager authenticationManager, IQueueManager queueManager, IConfiguration configuration, IMessageLogger logger)
 {
     _authenticationManager = authenticationManager;
     _queueManager          = queueManager;
     _configuration         = configuration;
     _logger = logger;
 }
コード例 #16
0
 public StreamProjection(
     ICollectionWrapper <StreamReadModel, Int64> streamReadModelCollection,
     IDocumentWriter documentWriter,
     IBlobStore blobStore,
     IQueueManager queueDispatcher,
     IReader <DocumentDescriptorReadModel, DocumentDescriptorId> documentDescriptorReadModel)
 {
     if (queueDispatcher is IObserveProjection)
     {
         Observe(queueDispatcher as IObserveProjection);
     }
     _streamReadModelCollection   = streamReadModelCollection;
     _documentDescriptorReadModel = documentDescriptorReadModel;
     _documentWriter = documentWriter;
     _blobStore      = blobStore;
     _streamReadModelCollection.Attach(this, false);
     if (_streamReadModelCollection.All.Any())
     {
         _lastId = _streamReadModelCollection.All.Max(s => s.Id);
     }
     else
     {
         _lastId = 0;
     }
 }
コード例 #17
0
        public NimbusTopicMessageSender(IQueueManager queueManager, string topicPath)
        {
            _queueManager = queueManager;
            _topicPath = topicPath;

            _topicClient = new Lazy<TopicClient>(() => _queueManager.CreateTopicSender(_topicPath));
        }
コード例 #18
0
 public SaveVoteJob(
     IQueueManager queueManager,
     ILogger <SaveVoteJob> logger)
 {
     _logger       = logger;
     _queueManager = queueManager;
 }
コード例 #19
0
 /// <summary>
 /// Executes the specified queue manager.
 /// </summary>
 /// <param name="queueManager">The queue manager.</param>
 /// <returns></returns>
 public CommandResult Execute(IQueueManager queueManager)
 {
     try
     {
         if (this._retrySkipCount == 0)
         {
             this._attemptCount++;
             this.InternalExecute();
             if (this._attemptCount > 1)
             {
                 queueManager.LogEvent(EventLogEntryType.Information, 0x40004405L,Environment.MachineName);
             }
             return CommandResult.Success;
         }
         this._retrySkipCount--;
         return CommandResult.Retry;
     }
     catch (Exception exception)
     {
         var sqlException = exception as SqlException;
         var asyncServiceException = exception as AsyncServiceException;
         if ((sqlException == null) && (asyncServiceException == null))
         {
             throw;
         }
         if (queueManager.ShuttingDown)
         {
             queueManager.LogEvent(EventLogEntryType.Error, 0xc0004409L, Environment.MachineName, exception.ToString() );
             return CommandResult.Failure;
         }
         return CalculateRetryOrFailure(queueManager, exception);
     }
 }
        public void SetUp()
        {
            TestMessageRecorder.Clear();
            FubuTransport.Reset();

            // Need to do something about this.  Little ridiculous
            var settings = new BusSettings
            {
                Downstream = "lq.tcp://localhost:2040/downstream".ToUri()
            };
            var lightningUri = settings.Downstream.ToLightningUri();

            var container = new Container();

            container.Inject(settings);



            _runtime = FubuTransport.For <ErrorRegistry>().StructureMap(container)
                       .Bootstrap();
            //_runtime.Factory.Get<IPersistentQueues>().ClearAll();

            theServiceBus = _runtime.Factory.Get <IServiceBus>();

            _queueManager = _runtime.Factory.Get <IPersistentQueues>().ManagerFor(lightningUri.Port, true);

            message1 = new OneMessage();

            theServiceBus.Send(message1);
        }
コード例 #21
0
        public async void Init(IQueueManager queueManager)
        {
            _hubConnection = new HubConnectionBuilder().WithUrl("http://localhost:44364/hub").Build();
            await _hubConnection.StartAsync();

            queueManager.AddMessageConsumer(BrokerSettings.ResultQueue, OnMessageConsume);
        }
コード例 #22
0
 public LightningQueuesChannel(Uri address, string queueName, IQueueManager queueManager, IDelayedMessageCache<MessageId> delayedMessages)
 {
     _address = address;
     _queueName = queueName;
     _queueManager = queueManager;
     _delayedMessages = delayedMessages;
 }
コード例 #23
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MessageQueue"/> class.
        /// </summary>
        /// <param name="manager"> The queue manager for underlying queues.</param>
        /// <exception cref="System.ArgumentNullException">The manager argument can not be null.</exception>
        public MessageQueue(IQueueManager manager)
        {
            if (manager == null)
                throw new ArgumentNullException("manager");

            _manager = manager;
        }
コード例 #24
0
        /// <summary>
        /// Retrieves the <see cref="MessageBusConfiguration"/> section from the host configuration and
        /// starts a <see cref="QueueController"/>.
        /// </summary>
        public void Start()
        {
            this._logger.LogInformation("Starting the bus manager...");

            MessageBusInfo messageBusInfo = HostConfiguration.MessageBusConfiguration.Map();

            if (!this.IsConfigurationValid(messageBusInfo))
            {
                this._logger.LogInformation("Configuration is not valid, stopping bus manager.");
                return;
            }
            else
            {
                this._logger.LogInformation("Configuration is valid.");
            }

            this._partComposer.BuildContainer(messageBusInfo, this._handlerManager);

            if (!this._handlerManager.TryInitializion(this._logger))
            {
                this._logger.LogInformation("The HandlerManager could not be initialized, stopping bus manager.");
                return;
            }

            this._queueController = new QueueManager(this.BuildQueues(messageBusInfo));

            this._queueController.Initialize();

            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(this.ResolveEventHandler);
        }
コード例 #25
0
ファイル: AuthWorker.cs プロジェクト: kolyavinge/PhotoBank
 public AuthWorker(
     IMessageProcessorFactory processorFactory, IQueueManager queueManager, IMessageLogger logger)
 {
     _processorFactory = processorFactory;
     _logger           = logger;
     queueManager.AddMessageConsumer(AuthSettings.AuthInputQueue, OnMessageConsume);
 }
コード例 #26
0
 public NimbusTopicMessageSender(IQueueManager queueManager, string topicPath, ILogger logger)
     : base()
 {
     _queueManager = queueManager;
     _topicPath = topicPath;
     _logger = logger;
 }
コード例 #27
0
        public SendOutboxMessageObserver(IQueueManager queueManager)
        {
            Guard.AgainstNull(queueManager, nameof(queueManager));

            _queueManager = queueManager;
            _log          = Log.For(this);
        }
コード例 #28
0
 protected ReleaseWatcher(IOptions <ReleaseWatcherOptions> options, IQueueManager queue, ILogger <T> logger, IMapper mapper)
     : base(options)
 {
     this.Logger = logger;
     this.Mapper = mapper;
     this.Queue  = queue.GetIncomingQueue <T>();
 }
        public void SetUp()
        {
            TestMessageRecorder.Clear();

            // Need to do something about this.  Little ridiculous
            var settings = new BusSettings
            {
                Downstream = "lq.tcp://localhost:2040/downstream".ToUri()
            };
            var lightningUri = settings.Downstream.ToLightningUri();


            _runtime = FubuRuntime.For <ErrorRegistry>(x =>
            {
                x.Services.For <BusSettings>().Use(settings);
            })
            ;
            //_runtime.Get<IPersistentQueues>().ClearAll();

            theServiceBus = _runtime.Get <IServiceBus>();

            _queueManager = _runtime.Get <IPersistentQueues>().ManagerFor(lightningUri.Port, true);

            message1 = new OneMessage();

            theServiceBus.Send(message1);
        }
コード例 #30
0
ファイル: WorkerPool.cs プロジェクト: danielgerlag/Polaris1
        protected IQueueManager CreateQueue()
        {
            IQueueManager result = IoC.Container.ResolveKeyed <IQueueManager>(QueueKey);

            //result.Init();
            return(result);
        }
コード例 #31
0
 public PhotoWorker(
     IMessageProcessorFactory processorFactory, IQueueManager queueManager, IMessageLogger logger)
 {
     _processorFactory = processorFactory;
     _logger           = logger;
     queueManager.AddMessageConsumer(PhotoSettings.PhotoInputQueue, OnMessageConsume);
 }
コード例 #32
0
 public AzureServiceBusQueueMessageSender(IBrokeredMessageFactory brokeredMessageFactory, ILogger logger, IQueueManager queueManager, IRetry retry, string queuePath)
 {
     _brokeredMessageFactory = brokeredMessageFactory;
     _queueManager = queueManager;
     _retry = retry;
     _queuePath = queuePath;
     _logger = logger;
 }
コード例 #33
0
 public AzureServiceBusTopicMessageSender(IBrokeredMessageFactory brokeredMessageFactory, ILogger logger, IQueueManager queueManager, IRetry retry, string topicPath)
 {
     _queueManager           = queueManager;
     _retry                  = retry;
     _topicPath              = topicPath;
     _logger                 = logger;
     _brokeredMessageFactory = brokeredMessageFactory;
 }
コード例 #34
0
        public PerformanceMonitor(IQueueManager queueManager)
        {
            this.queueManager = queueManager;

            AssertCountersExist();
            AttachToEvents();
            SyncWithCurrentQueueState();
        }
コード例 #35
0
        public HandleRequestObserver(IQueueManager queueManager, INetMQServerConfiguration configuration)
        {
            Guard.AgainstNull(queueManager, nameof(queueManager));
            Guard.AgainstNull(configuration, nameof(configuration));

            _queueManager  = queueManager;
            _configuration = configuration;
        }
コード例 #36
0
 public ErrorHeaderViewModel(
     IEventAggregator eventAggregator,
     IContentDecoder <IList <HeaderInfo> > decoder,
     IQueueManager queueManager)
     : base(eventAggregator, decoder, queueManager)
 {
     DisplayName = "Errors";
 }
コード例 #37
0
 public WindowsServiceBusQueueMessageSender(IBrokeredMessageFactory brokeredMessageFactory, ILogger logger, IQueueManager queueManager, IRetry retry, string queuePath)
 {
     _brokeredMessageFactory = brokeredMessageFactory;
     _queueManager           = queueManager;
     _retry     = retry;
     _queuePath = queuePath;
     _logger    = logger;
 }
コード例 #38
0
 public MatchmakingHostedService(IQueueManager queueManager, IMatchmakingQueueListenerFactory matchmakingQueueListenerFactory, IOutboundQueueListener outboundQueueListener,
                                 ILogger <MatchmakingHostedService> logger)
 {
     _queueManager = queueManager;
     _matchmakingQueueListenerFactory = matchmakingQueueListenerFactory;
     _outboundQueueListener           = outboundQueueListener;
     _logger = logger;
 }
コード例 #39
0
 public WindowsServiceBusTopicMessageSender(IBrokeredMessageFactory brokeredMessageFactory, ILogger logger, IQueueManager queueManager, IRetry retry, string topicPath)
 {
     _queueManager = queueManager;
     _retry = retry;
     _topicPath = topicPath;
     _logger = logger;
     _brokeredMessageFactory = brokeredMessageFactory;
 }
コード例 #40
0
        private async Task InitializeAsync(IQueueManager qm, IObjectProvider objProvider)
        {
            await Queues.InitializeAsync(qm, objProvider);

            await Channels.InitializeAsync(qm, objProvider);

            await Listeners.InitializeAsync(qm, objProvider);
        }
コード例 #41
0
 public UserPageController(IConfiguration configuration, UserManager <ApplicationUser> userManager, IQueueManager storage, IUserRepository userRepository)
 {
     _configuration  = configuration;
     _userManager    = userManager;
     _storage        = storage;
     _userRepository = userRepository;
     //_client = new ApiRequest(_configuration["ApiEndpointUrl"], userId, authKey);
 }
コード例 #42
0
 public ExceptionHandlerMiddleware(RequestDelegate nextDelegate, ILogger <ExceptionHandlerMiddleware> logger, IQueueManager queueManager,
                                   IHostingEnvironment environment)
 {
     this.nextDelegate = nextDelegate;
     this.logger       = logger;
     this.queueManager = queueManager;
     this.environment  = environment;
 }
コード例 #43
0
 public ErrorHeaderViewModel(
     IEventAggregator eventAggregator, 
     IContentDecoder<IList<HeaderInfo>> decoder, 
     IQueueManager queueManager) 
     : base(eventAggregator, decoder, queueManager)
 {
     DisplayName = "Errors";
 }
コード例 #44
0
 public QueueMessageDispatcher(ILogger logger, IQueueManager queueManager, IBrokeredMessageFactory brokeredMessageFactory,
     IEndpointNamingPolicy endpointNamingPolicy, MaxConcurrentReceiverCallsSetting maxConcurrentReceiverCallsSetting)
 {
     _logger = logger;
     _queueManager = queueManager;
     _brokeredMessageFactory = brokeredMessageFactory;
     _endpointNamingPolicy = endpointNamingPolicy;
     _maxConcurrentReceiverCallsSetting = maxConcurrentReceiverCallsSetting;
 }
コード例 #45
0
 public OnReceiveMessageReceiver(IQueueManager queueManager, string queuePath,
     ConcurrentHandlerLimitSetting concurrentHandlerLimit, PrefetchCountSetting prefetchCount, IZombusLogger logger)
 {
     _queueManager = queueManager;
     _queuePath = queuePath;
     _concurrentHandlerLimit = concurrentHandlerLimit;
     _prefetchCount = prefetchCount;
     _logger = logger;
 }
コード例 #46
0
 public void TestInitialize()
 {
     IList<string> machines = new List<string> { Environment.MachineName, "AnotherMachine" };
     QueueManager = Substitute.For<IQueueManager>();
     Explorer = Substitute.For<IQueueExplorerViewModel>();
     Network = Substitute.For<INetworkOperations>();
     Model = new Desktop.Shell.QueueCreationViewModel(QueueManager, Explorer, Network);
     Network.GetMachines().Returns(Task.FromResult(machines));
 }
コード例 #47
0
        public MainWindowViewModel(
            IQueueManager queueManager,
            IMessageFactory factory)
        {
            this.queueManager = queueManager;
            this.messageFactory = factory;

            this.PoppedMessage = string.Empty;
        }
コード例 #48
0
        public MessageManagementPresenter()
        {
            view = new MessageManagementView(this);

            queueManager = new QueueManager();

            messageConfiguration = new MessageConfiguration();

            serializer = messageConfiguration.GetSerializer();
        }
コード例 #49
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MessageService"/> class.
        /// </summary>
        /// <param name="manager">The queue manager.</param>
        /// <exception cref="ArgumentNullException"><paramref name="manager"/> is <see langword="null" />.</exception>
        public MessageService(IQueueManager manager)
        {
            if (manager == null)
                throw new ArgumentNullException("manager");

            _processors = new Lazy<IList<IMessageProcessor>>(CreateProcesses);
            _manager = manager;
            _activeProcesses = 0;

        }
コード例 #50
0
ファイル: ExplorerViewModel.cs プロジェクト: 4lx/Profiler
 public ExplorerViewModel(
     IQueueManager queueManager,
     IEventAggregator eventAggregator,
     IWindowManagerEx windowManager)
 {
     _queueManager = queueManager;
     _eventAggregator = eventAggregator;
     _windowManager = windowManager;
     Items = new BindableCollection<ExplorerItem>();
 }
コード例 #51
0
 protected HeaderInfoViewModelBase(
     IEventAggregator eventAggregator, 
     IContentDecoder<IList<HeaderInfo>> decoder, 
     IQueueManager queueManager)
 {
     _decoder = decoder;
     EventAggregator = eventAggregator;
     QueueManager = queueManager;
     ConditionsMap = new Dictionary<Func<HeaderInfo, bool>, Action<HeaderInfo>>();
     MapHeaderKeys();
 }
コード例 #52
0
 public NimbusSubscriptionMessageReceiver(IQueueManager queueManager,
                                          string topicPath,
                                          string subscriptionName,
                                          ConcurrentHandlerLimitSetting concurrentHandlerLimit,
                                          ILogger logger)
     : base(concurrentHandlerLimit, logger)
 {
     _queueManager = queueManager;
     _topicPath = topicPath;
     _subscriptionName = subscriptionName;
 }
コード例 #53
0
ファイル: MusicService.cs プロジェクト: Jc54/PlayMe
	    public MusicService(ILogger logger,
			IMusicProviderFactory musicProviderFactory,
			IAutoPlay autoplayer,
            IDataService<QueuedTrack> queuedTrackDataService,
			IDataService<User> adminUserDataService,
			ISearchSuggestionService searchSuggestionService,
			IRickRollService rickRollService,
			IBroadcastService broadcastService,
			ISoundBoardService soundBoardService,
            ISkipHelper skipHelper,
            IVolume volume,
            IQueueManager queueManager,
            IAlreadyQueuedHelper alreadyQueuedHelper,
            IMusicPlayer musicPlayer,
            ICallbackClient callbackClient,
            IUserService userService,
			IVetoHelper vetoHelper,
            IQueueRuleHelper queueRuleHelper,
            ISettings settings,
            ISearchRuleHelper searchRuleHelper
            )
		{
	        this.vetoHelper = vetoHelper;
	        this.callbackClient = callbackClient;
	        this.alreadyQueuedHelper = alreadyQueuedHelper;
	        this.queueManager = queueManager;
	        this.broadcastService = broadcastService;
			this.rickRollService = rickRollService;
			this.logger = logger;
			this.musicProviderFactory = musicProviderFactory;
			this.autoplayer = autoplayer;
			this.queuedTrackDataService = queuedTrackDataService;
			this.adminUserDataService = adminUserDataService;
			this.searchSuggestionService = searchSuggestionService;
			this.soundBoardService = soundBoardService;
			this.skipHelper = skipHelper;
            this.volume = volume;
            this.musicPlayer = musicPlayer;
	        this.callbackClient = callbackClient;
            this.userService = userService;            
            this.queueRuleHelper = queueRuleHelper;
	        this.settings = settings;

	        this.searchRuleHelper = searchRuleHelper;
	        foreach (var provider in musicProviderFactory.GetAllMusicProviders())
			{
				provider.TrackEnded += musicProvider_TrackEnded;        
			}

			if (settings.AutoStart)
			{
			    PlayNextTrack();
			}
		}
コード例 #54
0
        /// <summary>
        /// Set the host application as an MVC website.
        /// </summary>
        /// <param name="transportConfiguration">The transportation configuration.</param>
        /// <param name="routes">The MVC route table to add the service bus actions too.</param>
        /// <param name="queueManager">The embedded persisted message queue.</param>
        /// <returns>The <see cref="IHostApplicationConfiguration"/>.</returns>
        public static IHostApplicationConfiguration AsMvcServiceBus(this ITransportConfiguration transportConfiguration, RouteCollection routes, IQueueManager queueManager)
        {
            Argument.CannotBeNull(routes, "routes", "Route collection must be used to add service bus HTTP methods.");

            routes.MapRoute(
                "MessageReceive",
                "service-bus/message",
                new { controller = "Message", action = "Receive" },
                new[] { typeof(MessageController).Namespace });

            return new HostApplicationConfiguration(transportConfiguration, queueManager);
        }
コード例 #55
0
 public QueueCreationViewModel(
     IQueueManager queueManager, 
     IQueueExplorerViewModel explorer,
     INetworkOperations networkOperations)
 {
     _queueManager = queueManager;
     _explorer = explorer;
     _networkOperations = networkOperations;
     Machines = new List<string>();
     DisplayName = "Queue";
     IsTransactional = true;
 }
コード例 #56
0
 private IEnumerable<QueueDto> buildQueues(IQueueManager queues)
 {
     foreach (var queue in queues.Queues)
     {
         yield return new QueueDto
         {
             Port = queues.Endpoint.Port,
             QueueName = queue,
             NumberOfMessages = queues.GetNumberOfMessages(queue)
         };
     }
 }
コード例 #57
0
 public AzureServiceBusQueueMessageReceiver(IBrokeredMessageFactory brokeredMessageFactory,
                                              IQueueManager queueManager,
                                              string queuePath,
                                              ConcurrentHandlerLimitSetting concurrentHandlerLimit,
                                              IGlobalHandlerThrottle globalHandlerThrottle,
                                              ILogger logger)
     : base(concurrentHandlerLimit, globalHandlerThrottle, logger)
 {
     _queueManager = queueManager;
     _queuePath = queuePath;
     _logger = logger;
     _brokeredMessageFactory = brokeredMessageFactory;
 }
コード例 #58
0
 public QueueManagerModel(IQueueManager queueManager, IUrlRegistry urls)
 {
     Queues = new QueueManagerTableTag(queueManager, urls);
     EnableProcessedMessageHistory = queueManager.Configuration.EnableProcessedMessageHistory;
     EnableOutgoingMessageHistory = queueManager.Configuration.EnableOutgoingMessageHistory;
     Path = queueManager.Path;
     Port = queueManager.Endpoint.Port;
     OldestMessageInOutgoingHistory = queueManager.Configuration.OldestMessageInOutgoingHistory;
     OldestMessageInProcessedHistory = queueManager.Configuration.OldestMessageInProcessedHistory;
     NumberOfMessagesToKeepInOutgoingHistory = queueManager.Configuration.NumberOfMessagesToKeepInOutgoingHistory;
     NumberOfMessagesToKeepInProcessedHistory = queueManager.Configuration.NumberOfMessagesToKeepInProcessedHistory;
     NumberOfMessagIdsToKeep = queueManager.Configuration.NumberOfReceivedMessageIdsToKeep;
 }
コード例 #59
0
 public OnReceiveSubscriptionMessageReceiver(IQueueManager queueManager,
                                          string topicPath,
                                          string subscriptionName,
                                          ConcurrentHandlerLimitSetting concurrentHandlerLimit,
                                          PrefetchCountSetting prefetchCountSetting,
                                          IZombusLogger logger)         
 {
     _queueManager = queueManager;
     _topicPath = topicPath;
     _subscriptionName = subscriptionName;
     _concurrentHandlerLimit = concurrentHandlerLimit;
     _prefetchCountSetting = prefetchCountSetting;
     _logger = logger;
 }
コード例 #60
0
 internal ResponseMessagePumpFactory(IQueueManager queueManager,
                                     ResponseMessagePumpDispatcher dispatcher,
                                     ILogger logger,
                                     ReplyQueueNameSetting replyQueueName,
                                     IClock clock,
                                     ConcurrentHandlerLimitSetting concurrentHandlerLimit)
 {
     _logger = logger;
     _queueManager = queueManager;
     _replyQueueName = replyQueueName;
     _clock = clock;
     _concurrentHandlerLimit = concurrentHandlerLimit;
     _dispatcher = dispatcher;
 }