コード例 #1
0
        static void Main(string[] args)
        {
            var ckmio = new CkmioClient("community-test-key", "community-test-secret", "Khady", "");

            ckmio.Start();
            ckmio.Debug = false;
            String topicName  = "A brand new topic";
            String streamName = "A brand new Stream";

            ckmio.SubscribeToChat();
            ckmio.SubscribeToTopic(topicName);
            ckmio.StartFunnel(streamName, new FunnelCondition[] { new FunnelCondition("age", "greater_than", 40) });
            ckmio.ChatMessageHandler  = (ChatMessage message) => Console.WriteLine("Received Message from " + message.From);
            ckmio.TopicUpdateHandler  = (TopicUpdate topicUpdate) => Console.WriteLine("Topic Update: " + topicUpdate.Content);
            ckmio.FunnelUpdateHandler = (FunnelUpdate FunnelUpdate) => Console.WriteLine("Funnel Update: " + FunnelUpdate.Content);

            ckmio.Send("Khady", "Hello");
            for (var i = 0; i < 10000; i++)
            {
                ckmio.UpdateTopic(topicName, "Topic Update");
            }
            ckmio.SendToStream(streamName, new { age = 60, name = "Bob", gender = "Male" });
            ckmio.SendToStream(streamName, new { age = 20, name = "Alice", gender = "Female" });
            Console.ReadLine();
            ckmio.Stop();
        }
コード例 #2
0
        public void Start()
        {
            if (MioClient == null)
            {
                MioClient = new CkmioClient("community-test-key",
                                            "community-test-secret",
                                            "Producer", "xpassw0rd");

                MioClient.Start();
            }
            PullingTimer.Elapsed += UpdateStream;
            PullingTimer.Enabled  = true;
        }
コード例 #3
0
        public void Start()
        {
            if (MioClient == null)
            {
                MioClient = new CkmioClient("community-test-key",
                                            "community-test-secret",
                                            "Producer", "xpassw0rd");

                MioClient.Start();
            }
            MioClient.StartFunnel(AxesStreamName, new FunnelCondition[] {});
            MioClient.StartFunnel(OrdersStreamName, new FunnelCondition[] {});
            MioClient.FunnelUpdateHandler = OnNewAxe;
        }
コード例 #4
0
        public AxesProcessor()
        {
            IConfiguration config = new ConfigurationBuilder()
                                    .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
                                    .Build();

            this.AxesStreamName             = config["AMIntermediaServices:AxesStreamName"];;
            this.IncomingFilesDirectoryPath = config["AMIntermediaServices:AxesIncomingFilesDirectory"];
            this.ProcessingDirectoryPath    = config["AMIntermediaServices:AxesProcessingLogDirectory"];
            this.AxesFilesFilter            = config["AMIntermediaServices:AxesFilesFilter"];
            this.MioClient = new CkmioClient("community-test-key",
                                             "community-test-secret",
                                             "Producer", "xpassw0rd");
            this.MioClient.Start();
        }