Ejemplo n.º 1
0
        public static PublishingAgent Create(
            Original.IConnection conn,
            MyWorkerContext ctx,
            CountdownEvent cde
            )
        {
            var instance = new PublishingAgent();

            instance._conn   = conn;
            instance._ctx    = ctx;
            instance._cde    = cde;
            instance._buffer = new byte[1000 + (int)(ctx.Description.Length * 1.1)];
            return(instance);
        }
Ejemplo n.º 2
0
        public static void RunPublisher(
            Original.IConnection conn,
            MyWorkerContext ctx
            )
        {
            Console.WriteLine("Pub start " + ctx.Subject);
            ctx.CronoStart();

            var agent = PublishingAgent.Create(conn, ctx, null);

            agent.Worker(null);

            ctx.CronoStop();
            Console.WriteLine($"Pub end {ctx.FormatStats(1)}");
        }