Exemplo n.º 1
0
 public void OnStop()
 {
     try
     {
         _agents.Values.ForEach(a => a.Stop());
         _listener.Dispose();
         _broadcastListener.Dispose();
         WorkflowShared.RemoveQueueFromWorkflowExchange(_queueConnection, _hostId, _workflowMessagingKey);
         WorkflowShared.RemoveQueueFromWorkflowBroadcast(_queueConnection, WorkflowShared.WorkflowFanoutExchange, _workflowMessagingKey);
     }
     catch (Exception ex)
     {
         _dblog.WarnFormat("Exception while stopping workflow host: {0}", ex.ToString());
     }
 }
Exemplo n.º 2
0
        public void SpoolBatch(IEnumerable <TData> data)
        {
            Debug.Assert(IsInitialized);
            Debug.Assert(IsStarted);
            Debug.Assert(null != data);

            if (data.Any())
            {
                var pages = data.Partition(_pageSize);
                foreach (var page in pages)
                {
                    var pageNumber = _tracking.LastPageNumber.ToString("d19", CultureInfo.InvariantCulture);
                    _log.InfoFormat("Spooling page {0} of {1}", pageNumber, _spoolId);
                    string pageName = pageNumber + "page";
                    _pageData.SaveAsync(pageName, page, _lifeTime);
                    _tracking.LastPageNumber++;
                }
            }
            else
            {
                _dblog.WarnFormat("Tried to spool an empty batch of data on {0}", _spoolId);
            }
        }