public ChatHub(IApplicationConfig applicationConfig, ICacheHelper cacheHelper, IQueueDataModel queueDataModel, IAgentDataModel agentDataModel) { _applicationConfig = applicationConfig; _cacheHelper = cacheHelper; _queueDataModel = queueDataModel; _agentDataModel = agentDataModel; }
static void Main(string[] args) { #region DI Container Builder var builder = new ContainerBuilder(); builder.RegisterType <RedisHelper>().As <ICacheHelper>(); builder.RegisterType <ApplicationConfig>().As <IApplicationConfig>(); builder.RegisterType <RabbitMQHelper>().As <IMessageQueueHelper>(); builder.RegisterType <QueueDataModel>().As <IQueueDataModel>(); builder.RegisterType <AgentDataModel>().As <IAgentDataModel>(); builder.RegisterType <ChatHub>().As <IChatHub>(); builder.RegisterType <QueueDataModel>().As <IQueueDataModel>().SingleInstance(); var container = builder.Build(); #endregion using (var scope = container.BeginLifetimeScope()) { #region DI Resolver _cacheHelper = scope.Resolve <ICacheHelper>(); _messageQueueHelper = scope.Resolve <IMessageQueueHelper>(); _applicationConfig = scope.Resolve <IApplicationConfig>(); _queueDataModel = scope.Resolve <IQueueDataModel>(); _agentDataModel = scope.Resolve <IAgentDataModel>(); _chatHub = scope.Resolve <IChatHub>(); var chatMonitorHelper = new ChatMonitorHelper(_queueDataModel, _agentDataModel, _chatHub); var webserverHelper = new WebServerHelper(_applicationConfig); #endregion #region Processors //Start Message Queue Listener Task.Run(() => _messageQueueHelper.ReadMessages <QueueMetaData>(_applicationConfig, chatMonitorHelper.ProcessQueue)); //Start Message Queue Processor Task.Run(() => chatMonitorHelper.MonitorQueue()); //Start WebSocket Server Task.Run(() => webserverHelper.StartWebServer()); #endregion } Console.ReadLine(); }
public AgentHub(IAgentDataModel agentDataModel, IQueueDataModel queueDataModel, IChatHub chathub) { _agentDataModel = agentDataModel; _queueDataModel = queueDataModel; _chatHub = chathub; }
public ChatMonitorHelper(IQueueDataModel queueDataModel, IAgentDataModel agentDataModel, IChatHub chatHub) { _queueDataModel = queueDataModel; _agentDataModel = agentDataModel; _chatHub = chatHub; }
public AgentHelper(IAgentDataModel agentDataModel, IQueueDataModel queueDataModel, IChatHub chatHub) { this._agentDataModel = agentDataModel; this._queueDataModel = queueDataModel; this._chatHub = chatHub; }