Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #3
0
        private void FalseMatcher(int runNumber)
        {
            EventBroker eventBroker = new EventBroker();

            eventBroker.AddGlobalMatcher(new Matcher(false));

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

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

            this.Run(
                p.FireEvent,
                runNumber + " false matcher",
                0);
        }
Beispiel #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);
        }