class Amber::Server

Included Modules

Defined in:

amber/server/server.cr

Constant Summary

Log = ::Log.for(self)
UNIX_SOCKET_LOCK_MODE = 384

Access mode of the <socket>.lock file that serializes binds: only the server's own user may open it, so no one else can hold the lock.

UNIX_SOCKET_LOCK_RETRY_INTERVAL = 50.milliseconds

Interval between attempts to take a lock another start holds.

UNIX_SOCKET_LOCK_TIMEOUT = 10.seconds

How long a start waits for another start to release the bind lock before it fails with Socket::BindError.

UNIX_SOCKET_MODE = 432

Access mode of the socket file server.unix_socket creates: its owner and group may connect, and no one else. Every peer on the socket is a trusted proxy, so a wider mode would let any local user forge the scheme and client address.

Constructors

Class Method Summary

Instance Method Summary

Macros inherited from module Amber::DSL::Server

pipeline(*valves) pipeline, routes(valve, scope = "") routes

Constructor Detail

def self.new #

[View source]

Class Method Detail

def self.all_routes : Array(Router::RouteInfo) #

Returns all registered routes as structured data for introspection.


[View source]
def self.configure(&) #

Configure should probably be deprecated in favor of settings.


[View source]
def self.handler #

[View source]
def self.instance #

[View source]
def self.pubsub_adapter #

[View source]
def self.router #

[View source]
def self.start #

[View source]

Instance Method Detail

def adapter_based_pubsub : Amber::Adapters::PubSubAdapter | Nil #

[View source]
def adapter_based_pubsub=(adapter_based_pubsub : Amber::Adapters::PubSubAdapter | Nil) #

[View source]
def check_listener_settings! : Nil #

Raises Amber::Exceptions::ConfigurationError before the server forks or binds when server.unix_socket is combined with TLS or with more than one process. The settings are read as they stand at start, after the environment file, AMBER_* variables and config/settings.cr.


[View source]
def handler : Amber::Pipe::Pipeline #

[View source]
def host_url #

[View source]
def initialize_adapters #

Initialize adapters based on configuration


[View source]
def project_name #

Returns the app name with every character that is not a letter, number, mark or underscore replaced by _, downcased.


[View source]
def pubsub_adapter : WebSocketAdapter #

[View source]
def pubsub_adapter=(pubsub_adapter : WebSocketAdapter) #

[View source]
def router : Amber::Router::Router #

[View source]
def run #

[View source]
def scheme #

[View source]
def settings #

[View source]
def ssl_enabled? #

[View source]
def start #

[View source]
def version #

[View source]