Esempio n. 1
0
        private void DotNetEvent(int runNumber)
        {
            var p = new Publisher();
            var s = new Subscriber();

            p.Event += s.HandleEvent;

            this.Run(
                p.FireEvent,
                runNumber + " .Net event",
                this.numberOfEvents * 9);
        }
Esempio n. 2
0
        private void SimpleEvent(int runNumber)
        {
            EventBroker eventBroker = new EventBroker();
            
            var p = new Publisher();
            var s = new Subscriber();

            eventBroker.Register(p);
            eventBroker.Register(s);

            this.Run(
                p.FireEvent,
                runNumber + " simple event",
                0);
        }
Esempio n. 3
0
        private void TrueMatcher(int runNumber)
        {
            EventBroker eventBroker = new EventBroker();

            eventBroker.AddGlobalMatcher(new Matcher(true));

            var p = new Publisher();
            var s = new Subscriber();

            eventBroker.Register(p);
            eventBroker.Register(s);

            this.Run(
                p.FireEvent,
                runNumber + " true matcher",
                0);
        }
Esempio n. 4
0
        private void Subscribers(int runNumber, int numberOfSubscribersInThisRun)
        {
            EventBroker eventBroker = new EventBroker();

            var p = new Publisher();
            var subscribers = new Subscriber[numberOfSubscribersInThisRun];

            for (int i = 0; i < numberOfSubscribersInThisRun; i++)
            {
                subscribers[i] = new Subscriber();
                eventBroker.Register(subscribers[i]);
            }

            eventBroker.Register(p);
           
            this.Run(
                p.FireEvent,
                runNumber + " number of subscribers " + numberOfSubscribersInThisRun,
                -9 * this.numberOfEvents / 10);
        }