Beispiel #1
0
        /// <summary>
        /// Uses Horse.Mq Messaging Queue server
        /// </summary>
        public static HorseServer UseHorseMq(this HorseServer server, HorseMq horseMq)
        {
            HmqNetworkHandler handler = new HmqNetworkHandler(horseMq);

            horseMq.Server = server;

            horseMq.NodeManager.ConnectionHandler = new NodeConnectionHandler(horseMq.NodeManager, handler);
            server.UseHmq(handler);

            if (horseMq.NodeManager != null)
            {
                horseMq.NodeManager.SubscribeStartStop(server);
            }

            return(server);
        }
Beispiel #2
0
        /// <summary>
        /// Uses Horse.Mq Messaging Queue server
        /// </summary>
        public static HorseMq UseHorseMq(this HorseServer server, Action <HorseMqBuilder> cfg)
        {
            HorseMq           mq      = new HorseMq();
            HmqNetworkHandler handler = new HmqNetworkHandler(mq);

            mq.Server = server;

            mq.NodeManager.ConnectionHandler = new NodeConnectionHandler(mq.NodeManager, handler);
            server.UseHmq(handler);

            if (mq.NodeManager != null)
            {
                mq.NodeManager.SubscribeStartStop(server);
            }

            HorseMqBuilder builder = new HorseMqBuilder();

            builder.Server = mq;

            cfg(builder);
            return(mq);
        }
Beispiel #3
0
 /// <summary>
 ///
 /// </summary>
 public NodeManager(HorseMq server)
 {
     Server = server;
 }