Ejemplo n.º 1
0
        /// <summary>
        /// Create a new context should be called only once in an application, the context is passed around and provides access to the 
        /// infrastructure.
        /// </summary>
        /// <returns>Daytona Context</returns>
        public static Context Create()
        {
            var messageSerializerFactory = new MessageSerializerFactory(() => new BinarySerializer());

            return new Context(NetMQContext.Create(), messageSerializerFactory);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create a new conext should be called only once in  and application, the context is passed around and provides access to the 
        /// infrastructure.
        /// pass in a Lambda to use your own serialization e.g. () => new BinarySerializer()
        /// </summary>
        /// <param name="func">Lambda to return your Serialization implementation</param>
        /// <returns>Daytona Context</returns>
        public static Context Create(Func<ISerializer> func)
        {
            var messageSerializerFactory = new MessageSerializerFactory(func);

            return new Context(NetMQContext.Create(), messageSerializerFactory);
        }
Ejemplo n.º 3
0
 public Context(NetMQContext netMqContext, MessageSerializerFactory messageSerializerFactory)
     : this(netMqContext)
 {
     this.MessageSerializerFactory = messageSerializerFactory;
     this.ActorFactory = new Actor(netMqContext, this.MessageSerializerFactory.GetNewSerializer());
 }