historian v0.11.0-beta.2 Historian.UserInterfaceServer View Source

Stores the PageBuffer process for the TUI

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Get the current page buffer in the Historian.UserInterfaceServer process.

Callback implementation for GenServer.init/1.

Sets the page buffer in the Historian.UserInterfaceServer process, returns {:ok, ref} if the process has been successfully set or {:error, :dead_pid} if the process's spark of life has been smothered in shite...

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

get(page_ref)

View Source
get(page_ref :: reference() | nil) ::
  {:ok, page_buffer_pid :: pid()}
  | {:error, :dead_pid}
  | {:error, :stale_reference}

Get the current page buffer in the Historian.UserInterfaceServer process.

Returns:

  • {:ok, page_buffer_pid} - Success result.
  • {:error, :dead_pid} - Page buffer process is nothing but a dreadful reminder of our endless march towards death and being forgotten.
  • {:error, :stale_pid} - Reference belongs to a stale pid, if you do not care about the old pid, you can call this function with nil and it will return whatever the current pid is bypassing the reference check.

Parameters

  • page_ref: The reference returned when setting the page buffer or nil to skip stale ref check.

Callback implementation for GenServer.init/1.

Link to this function

set(page_buffer_pid)

View Source
set(page_buffer_pid :: pid()) :: {:ok, reference()} | {:error, :dead_pid}

Sets the page buffer in the Historian.UserInterfaceServer process, returns {:ok, ref} if the process has been successfully set or {:error, :dead_pid} if the process's spark of life has been smothered in shite...

Parameters