public CustomerInstance GetOrStartCustomerInstance(Uri requestUri) { if (requestUri == null) { throw new ArgumentNullException(nameof(requestUri)); } var instanceKey = _customerResolver.CreateInstanceKey(requestUri); CustomerInstance customerInstance; if (!_customers.TryGetValue(instanceKey, out customerInstance)) { var customer = _customerResolver.ResolveCustomer(instanceKey); if (customer != null && customer.Enabled) { customerInstance = CustomerInstance.Create(instanceKey, customer); _customers.TryAdd(instanceKey, customerInstance); Start(customerInstance); } } return(customerInstance); }
public void Execute(CustomerInstance customer) { Trace.WriteLine($"Customer {customer.Name}: Initializing EF."); }
public SignalRNotificationTransport(CustomerInstance customer) { _customer = customer; _hub = GlobalHost.ConnectionManager.GetHubContext <NotificationsHub>(); }
private void Start(CustomerInstance instance) { _startupTasks?.ForEach(t => t.Execute(instance)); instance.Start(); }