static MetaPool initializeGmQueue(MwsrThreadQueue msgQueue)
        {
            IPlatformSupport platform = new DefaultJsonPlatformSupport();

            GMQueue gmq = new GMQueue();

            gmq.initStateConcentratorFactory(new mtest.StateConcentratorFactory());
            gmq.initPlatformSupport(platform);
            gmq.initAuthority(String.Empty);


            //BasicMtQueue<ThreadQueueItem> msgQueue = new BasicMtQueue<ThreadQueueItem>();
            ThreadQueuePostman postMan = new ThreadQueuePostman(msgQueue, 1);

            SlotIdx      idx_;
            UInt64       id_       = gmq.add("test_node", postMan, out idx_);
            GMQTransport transport = new GMQTransport(gmq, "test_node", idx_, id_);

            MetaPool mp = new MetaPool();

            mp.setTransport(transport);
            mp.setPlatform(platform);

            return(mp);
        }
示例#2
0
        static void Main(string[] args)
        {
            IPlatformSupport platform = new DefaultJsonPlatformSupport();

            GMQueue gmq = new GMQueue();

            gmq.initStateConcentratorFactory(new basic_test.StateConcentratorFactory());
            gmq.initPlatformSupport(platform);
            gmq.initAuthority("");

            ThreadQueueManager.runNodeInAnotherThread(platform, gmq, new PublisherNodeFactory());

            ThreadQueueManager.runNodeInThisThread(platform, gmq, new SubscriberNodeFactory());
        }
        static void Main(string[] args)
        {
            RpgEngine.init();

            IPlatformSupport platform = new DefaultJsonPlatformSupport();

            SubscriberNode node = new SubscriberNode();

            node.initPlatform(platform);
            DllTransport tr = DllTransport.getThreadTransport();

            node.initDllTransport(tr);

            node.init();

            while (true)
            {
                node.checkIncomingMessages();

                Thread.Sleep(100);
            }
        }