class ServerFactory

Properties

protected LoggerInterface|null $logger
protected Dispatcher|null $eventDispatcher
protected ServerInterface|null $server
protected ServerConfig|null $config

Methods

__construct(Container $container)

No description

void
configure(array $config)

Configure the server with the given config array.

void
start()

Start the server.

getServer()

Get the server instance.

setServer(ServerInterface $server)

Set the server instance.

getEventDispatcher()

Get the event dispatcher instance.

setEventDispatcher(Dispatcher $eventDispatcher)

Set the event dispatcher instance.

LoggerInterface
getLogger()

Get the logger instance.

setLogger(LoggerInterface $logger)

Set the logger instance.

getConfig()

Get the server configuration.

Details

at line 24
__construct(Container $container)

No description

Parameters

Container $container

at line 31
void configure(array $config)

Configure the server with the given config array.

Parameters

array $config

Return Value

void

at line 41
void start()

Start the server.

Return Value

void

at line 49
ServerInterface getServer()

Get the server instance.

Return Value

ServerInterface

at line 68
ServerFactory setServer(ServerInterface $server)

Set the server instance.

Mutates the shared ServerFactory before startup; runtime use races across coroutines and changes the server used by later calls.

Parameters

ServerInterface $server

Return Value

ServerFactory

at line 78
Dispatcher getEventDispatcher()

Get the event dispatcher instance.

Return Value

Dispatcher

at line 92
ServerFactory setEventDispatcher(Dispatcher $eventDispatcher)

Set the event dispatcher instance.

Set before configure(); the constructed Server captures this dispatcher and does not pick up later changes.

Parameters

Dispatcher $eventDispatcher

Return Value

ServerFactory

at line 102
LoggerInterface getLogger()

Get the logger instance.

Return Value

LoggerInterface

at line 116
ServerFactory setLogger(LoggerInterface $logger)

Set the logger instance.

Set before configure(); the constructed Server captures this logger and does not pick up later changes.

Parameters

LoggerInterface $logger

Return Value

ServerFactory

at line 126
ServerConfig|null getConfig()

Get the server configuration.

Return Value

ServerConfig|null