package sihl

  1. Overview
  2. Docs
The modular functional web framework

Install

Dune Dependency

Authors

Maintainers

Sources

sihl-queue-0.1.5.tbz
sha256=bfa7bde9af02bb83d5ca39d54797b05b43317f033d93d24ca86ca42ff8ef83a1
sha512=6bb8727f65116e8042aa1fb77b3c14851ce5238f7b412adadf0f8e5b52d5310e8f06056c96bf76a82ffd7096753f49b2b0482f41e18ee1ca94310b874fe81bf9

doc/sihl.core/Core/App/index.html

Module Core.AppSource

A module to create Sihl apps.

Sourcetype t

An app is a thin convenience layer on top of the service container. It provides hooks that are executed at different stages in the app lifecycle.

Sourceval empty : t

empty returns an app without any services.

Sourceval with_services : Container.Service.t list -> t -> t

with_services services app adds services to an app.

Sourceval before_start : (Ctx.t -> unit Lwt.t) -> t -> t

before_start f app registers a callback f with app. The callback is executed before any service is started. This means you must not use any services here!

Sourceval after_start : (Ctx.t -> unit Lwt.t) -> t -> t

after_start f app registers a callback f with app. The callback is executed after all services are started. You can safely use services here.

Sourceval before_stop : (Ctx.t -> unit Lwt.t) -> t -> t

before_stop f app registers a callback f with app. The callback is executed before all services are stopped. You can safely use services here.

Sourceval after_stop : (Ctx.t -> unit Lwt.t) -> t -> t

after_stop f app registers a callback f with app. The callback is executed before after services are stopped. This means you must not use any services here!

Sourceval run : ?commands:Command.t list -> ?configuration:Configuration.data -> ?log_reporter:(unit -> Logs.reporter) -> ?args:string list -> t -> unit

run ?commands ?configuration ?log_reporter app is the main entry point to a Sihl app and starts the command line interface with commands merged with the commands provided by services.

configuration can be provided globally, overriding the configurations provided to the services.

An optional log_reporter can be provided to change the logging behavior. The default log reporter logs to stdout.

OCaml

Innovation. Community. Security.