Beispiel #1
0
        internal ActorType(Type actor, Type endpoint)
        {
            this.actor = actor;

            Name             = ActorTypeName.Of(actor);
            Sticky           = StickyAttribute.IsApplied(actor);
            keepAliveTimeout = Sticky ? TimeSpan.FromDays(365 * 10) : KeepAliveAttribute.Timeout(actor);
            Invoker          = InvocationPipeline.Instance.GetInvoker(actor, InvokerAttribute.From(actor));

            interleavePredicate = ReentrantAttribute.MayInterleavePredicate(actor);

            dispatcher = new Dispatcher(actor);
            dispatchers.Add(actor, dispatcher);

            Init(endpoint);
        }
Beispiel #2
0
        internal ActorType(Type @class, ActorInterface @interface, Type grain, string[] conventions)
        {
            Class     = @class;
            Interface = @interface;
            Grain     = grain;
            TypeCode  = grain.TypeCode();

            Sticky              = StickyAttribute.IsApplied(@class);
            keepAliveTimeout    = Sticky ? TimeSpan.FromDays(365 * 10) : KeepAliveAttribute.Timeout(@class);
            interleavePredicate = InterleaveAttribute.MayInterleavePredicate(@class);
            invoker             = InvokerAttribute.From(@class);

            dispatcher = new Dispatcher(@class, conventions);
            dispatchers.Add(@class, dispatcher);

            Init(grain);
        }