Serum.DevServer.Prompt (serum v1.5.1) View Source

Provides access to the Serum development server command line interface.

Link to this section Summary

Functions

Tries to start a Serum development server command line interface.

Link to this section Types

Specs

options() :: [{:allow_detach, boolean()}]

Specs

result() :: {:ok, :detached} | {:ok, :quitted} | {:error, :noproc}

Link to this section Functions

Specs

start(options()) :: result()

Tries to start a Serum development server command line interface.

This function first checks if the server is already running. If the server is not running, this function returns {:error, :noproc} immediately. Otherwise, it starts a loop which processes commands from the user. If the user runs the detach command, the loop completes and this function returns {:ok, :detached} tuple. If the user runs the quit command, the Serum development server will be stopped, and then this function will return {:ok, :quitted} tuple.

Options

  • allow_detach: Controls if users are allowed to detach the command line interface. Defaults to true.