Ejemplo n.º 1
0
        public ChannelConfigurationActor(IChannelConfigurationContext context, IHttpClientFactory httpClientFactory)
        {
            _Context = context;

            _ClientFactory = httpClientFactory;

            InstancePath = Context.Self.Path.ToStringWithAddress();

            Receive <GetConfigurationForChannel>(this.GetConfigurationForChannel);
            Receive <SaveConfigurationForChannel>(this.SaveConfigurationForChannel);
        }
		public ChannelManagerActor(IChannelConfigurationContext dataContext, IHubContext<LoggerHub, IChatLogger> chatLogger) {

			Logger = Context.GetLogger();

			_ChatLogger = ChatLoggerActor.Create(chatLogger);

			Receive<JoinChannel>(this.GetChannelActor);
			Receive<ReportCurrentChannels>(_ => {
				Sender.Tell(_ChannelActors.Select(kv => kv.Key).ToArray());
			});
			this.DataContext = dataContext;

		}
		public static IActorRef Create(ActorSystem system, IChannelConfigurationContext dataContext, IHubContext<LoggerHub, IChatLogger> chatLogger) {

			var props = Props.Create<ChannelManagerActor>(dataContext, chatLogger);
			return system.ActorOf(props, Name);

		}