Serum.DevServer.Prompt (serum_md v1.7.0)

Copy Markdown View Source

Provides access to the Serum development server command line interface.

Summary

Functions

Tries to start a Serum development server command line interface.

Types

options()

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

result()

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

Functions

start(options \\ [])

@spec 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.