package sihl

  1. Overview
  2. Docs
The Sihl web framework

Install

Dune Dependency

Authors

Maintainers

Sources

0.4.0.tar.gz
md5=5cfe63c96a5f4276d29b9ddb98c4bdc3
sha512=742bcdfb4bfb20be42bcf52cb7f7de8b05057524405c65f2479b476fc9f9a238461bd11d336082ccd2e2f91bfd166c597106cd1addbd12236178234421c28988

doc/sihl/Sihl/App/index.html

Module Sihl.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 : Sihl__.Core_container.Service.t list -> t -> t

with_services services app adds services to an app.

Sourceval before_start : (unit -> 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_stop : (unit -> 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:Sihl__.Core_command.t list -> ?log_reporter:Logs.reporter -> ?args:string list -> t -> unit

run ?commands ?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.

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

Sourceval run' : ?commands:Sihl__.Core_command.t list -> ?log_reporter:Logs.reporter -> ?args:string list -> t -> unit Lwt.t

run' ?commands ?log_reporter app is analogous to run. It is a helper to be used in tests that need Lwt.t.

OCaml

Innovation. Community. Security.