package sihl
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=52b28d3faac0a2243735285aa3f962aa
sha512=e7ff89bdba9f1afa3b115a056ae3d403f602685187a968485ea64a7cd1a18791f66b7480b682bf66acd3564dd89139162779d58a43c2389d785c98e246094a18
doc/sihl/Sihl/App/index.html
Module Sihl.AppSource
A module to create Sihl apps.
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.
with_services services app adds services to an app.
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!
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!
val run :
?commands:Sihl__.Core_command.t list ->
?log_reporter:Logs.reporter ->
?args:string list ->
t ->
unitrun ?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.
val run' :
?commands:Sihl__.Core_command.t list ->
?log_reporter:Logs.reporter ->
?args:string list ->
t ->
unit Lwt.trun' ?commands ?log_reporter app is analogous to run. It is a helper to be used in tests that need Lwt.t.