Inheritance: IFullModel, IRecoverable
コード例 #1
0
 public ConcurrentConsumerDispatcher(ModelBase model, ConsumerWorkService ws)
 {
     this.model = model;
     this.workService = ws;
     this.workService.RegisterKey(model);
     this.IsShutdown = false;
 }
コード例 #2
0
        public ConnectionBase(ConnectionFactory factory,
                              bool insist,
                              IFrameHandler frameHandler)
        {
            m_factory = factory;
            m_frameHandler = frameHandler;

            m_sessionManager = new SessionManager(this, 0);
            m_session0 = new MainSession(this);
            m_session0.Handler = new MainSession.SessionCloseDelegate(NotifyReceivedCloseOk);
            m_model0 = (ModelBase)Protocol.CreateModel(m_session0);

            StartMainLoop();
            Open(insist);
            StartHeartbeatLoops();
            AppDomain.CurrentDomain.DomainUnload += HandleDomainUnload;
        }
コード例 #3
0
        public Connection(IConnectionFactory factory, bool insist, IFrameHandler frameHandler, string clientProvidedName = null)
        {
            ClientProvidedName = clientProvidedName;
            KnownHosts = null;
            FrameMax = 0;
            m_factory = factory;
            m_frameHandler = frameHandler;
            ConsumerWorkService = new ConsumerWorkService();

            m_sessionManager = new SessionManager(this, 0);
            m_session0 = new MainSession(this) { Handler = NotifyReceivedCloseOk };
            m_model0 = (ModelBase)Protocol.CreateModel(m_session0);

            StartMainLoop(factory.UseBackgroundThreadsForIO);
            Open(insist);
        }
コード例 #4
0
        public Connection(IConnectionFactory factory, bool insist, IFrameHandler frameHandler)
        {
            KnownHosts = null;
            FrameMax = 0;
            m_factory = factory;
            m_frameHandler = frameHandler;
            this.ConsumerWorkService = new ConsumerWorkService(factory.TaskScheduler);

            m_sessionManager = new SessionManager(this, 0);
            m_session0 = new MainSession(this) { Handler = NotifyReceivedCloseOk };
            m_model0 = (ModelBase)Protocol.CreateModel(m_session0);

            StartMainLoop(factory.UseBackgroundThreadsForIO);
            Open(insist);

            #if NETFX_CORE
            #pragma warning disable 0168
            try
            {
                Windows.UI.Xaml.Application.Current.Suspending += this.HandleApplicationSuspend;
            }
            catch (Exception ex)
            {
                // If called from a desktop app (i.e. unit tests), then there is no current application
            }
            #pragma warning restore 0168
            #else
            AppDomain.CurrentDomain.DomainUnload += HandleDomainUnload;
            #endif
        }
コード例 #5
0
 internal BasicPublishBatch(ModelBase model)
 {
     this.model = model;
 }
コード例 #6
0
 internal BasicPublishBatch(ModelBase model, int sizeHint)
 {
     _model    = model;
     _commands = new List <OutgoingCommand>(sizeHint);
 }
コード例 #7
0
 public AsyncConsumerDispatcher(ModelBase model, AsyncConsumerWorkService ws)
 {
     _model       = model;
     _workService = ws;
     IsShutdown   = false;
 }
コード例 #8
0
 public ConcurrentConsumerDispatcher(ModelBase model, ConsumerWorkService ws)
 {
     this.model  = model;
     workService = ws;
     IsShutdown  = false;
 }
コード例 #9
0
 internal BasicPublishBatch(ModelBase model)
 {
     _model    = model;
     _commands = new List <OutgoingCommand>();
 }
コード例 #10
0
 protected abstract Task Execute(ModelBase model, IAsyncBasicConsumer consumer);
コード例 #11
0
 public void Schedule <TWork>(ModelBase model, TWork work) where TWork : Work
 {
     _workPools.GetOrAdd(model, StartNewWorkPool).Enqueue(work);
 }
コード例 #12
0
        public ConnectionBase(ConnectionParameters parameters,
                              bool insist,
                              IFrameHandler frameHandler)
        {
            m_parameters = parameters;
            m_frameHandler = frameHandler;

            m_sessionManager = new SessionManager(this);
            m_session0 = new MainSession(this);
            m_session0.Handler = new MainSession.SessionCloseDelegate(NotifyReceivedCloseOk);
            m_model0 = (ModelBase)Protocol.CreateModel(m_session0);

            StartMainLoop();
            Open(insist);
            StartHeartbeatLoops();
        }
コード例 #13
0
 public Task Execute(ModelBase model)
 {
     return(Execute(model, _asyncConsumer));
 }
コード例 #14
0
 public BasicPublishBatch(ModelBase model)
 {
     _model = model;
 }