Exemplo n.º 1
0
        public ShelfServiceController(Inbox inbox, string name, IServiceChannel coordinatorChannel, ShelfType shelfType,
                                      Type bootstrapperType, AssemblyName[] assemblyNames)
        {
            _inbox            = inbox;
            _name             = name;
            _publish          = new PublishChannel(coordinatorChannel, inbox);
            _shelfType        = shelfType;
            _bootstrapperType = bootstrapperType;
            _assemblyNames    = assemblyNames;

            _inbox.Loop(loop =>
            {
                loop.Receive <ShelfCreated>(x =>
                {
                    ShelfCreated(x);
                    loop.Continue();
                });

                loop.Receive <ServiceUnloaded>(x =>
                {
                    ShelfUnloaded(x);
                    loop.Continue();
                });
            });
        }