Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
 /// <summary>
 ///
 /// </summary>
 public NodeManager(HorseMq server)
 {
     Server = server;
 }