public IServer StartWith(Stage stage, Resources resources, int port, Configuration.SizingConf sizing, Configuration.TimingConf timing) { if (!_actor.IsStopped) { Action <IServer> cons128873 = __ => __.StartWith(stage, resources, port, sizing, timing); if (_mailbox.IsPreallocated) { _mailbox.Send(_actor, cons128873, null, StartWithRepresentation3); } else { _mailbox.Send(new LocalMessage <IServer>(_actor, cons128873, StartWithRepresentation3)); } } else { _actor.DeadLetters?.FailedDelivery(new DeadLetter(_actor, StartWithRepresentation3)); } return(null !); }
public ServerActor( Resources resources, Filters filters, int port, Configuration.SizingConf sizing, Configuration.TimingConf timing, string channelMailboxTypeName) { var start = DateExtensions.GetCurrentMillis(); _filters = filters; _dispatcherPoolIndex = 0; _world = Stage.World; _requestsMissingContent = new Dictionary <string, RequestResponseHttpContext>(); _maxMessageSize = sizing.MaxMessageSize; try { _responseBufferPool = new ConsumerByteBufferPool( ElasticResourcePool <IConsumerByteBuffer, Nothing> .Config.Of(sizing.MaxBufferPoolSize), sizing.MaxMessageSize); _dispatcherPool = new IDispatcher[sizing.DispatcherPoolSize]; for (int idx = 0; idx < sizing.DispatcherPoolSize; ++idx) { _dispatcherPool[idx] = Dispatcher.StartWith(Stage, resources); } _channel = ServerRequestResponseChannelFactory.Start( Stage, Stage.World.AddressFactory.WithHighId(ChannelName), channelMailboxTypeName, this, port, ChannelName, sizing.ProcessorPoolSize, sizing.MaxBufferPoolSize, sizing.MaxMessageSize, timing.ProbeInterval, timing.ProbeTimeout); var end = DateExtensions.GetCurrentMillis(); Logger.Info($"Server {ServerName} is listening on port: {port} started in {end - start} ms"); _requestMissingContentTimeout = timing.RequestMissingContentTimeout; LogResourceMappings(resources); } catch (Exception e) { var message = $"Failed to start server because: {e.Message}"; Logger.Error(message, e); throw new InvalidOperationException(message); } }
public IServer StartWith(Stage stage, Resources resources, Filters filters, int port, Configuration.SizingConf sizing, Configuration.TimingConf timing, string severMailboxTypeName, string channelMailboxTypeName) => ServerFactory.StartWith(stage, resources, filters, port, sizing, timing);
public IServer StartWith(Stage stage, Resources resources, Filters filters, int port, Configuration.SizingConf sizing, Configuration.TimingConf timing) => ServerFactory.StartWith(stage, resources, filters, port, sizing, timing);
public static IServer StartWith(Stage stage, Resources resources, Filters filters, int port, Configuration.SizingConf sizing, Configuration.TimingConf timing, string severMailboxTypeName, string channelMailboxTypeName) { var server = stage.ActorFor <IServer>( Definition.Has <ServerActor>( Definition.Parameters(resources, filters, port, sizing, timing, channelMailboxTypeName), severMailboxTypeName, ServerActor.ServerName), stage.World.AddressFactory.WithHighId(), stage.World.DefaultLogger); server.StartUp(); return(server); }
public static IServer StartWith(Stage stage, Resources resources, Filters filters, int port, Configuration.SizingConf sizing, Configuration.TimingConf timing) => StartWith(stage, resources, filters, port, sizing, timing, "queueMailbox", "queueMailbox");
public static IServer StartWith(Stage stage, Resources resources, int port, Configuration.SizingConf sizing, Configuration.TimingConf timing) => StartWith(stage, resources, Filters.None(), port, sizing, timing);
public static IServer StartWithAgent(Stage stage, Resources resources, Filters filters, int port, Configuration.SizingConf sizing, string severMailboxTypeName) { var server = stage.ActorFor <IServer>( () => new ServerActor(resources, filters, port, sizing, new Configuration.TimingConf(2, 2, 100), severMailboxTypeName), severMailboxTypeName, ServerActor.ServerName, stage.World.AddressFactory.WithHighId(), stage.World.DefaultLogger); server.StartUp(); return(server); }