yaq-yeps/300


is-daemon

YEP:300
Title:is-daemon
Authors:Blaise Thompson
Status:accepted
Tags:trait
Post-History:2020-04-22, 2020-07-14, 2021-02-22

Abstract

This YEP defines the is-daemon trait. This is a core trait which applies to all yaq daemon. In other words, this YEP defines the config, state, and messages that all yaq daemons must implement.

This trait has been accepted. See built documentation at at yaq.fyi.

Table of Contents

Motivation

The config, state, and messages here must be implemented by all yaq daemons.

Proposal

config: port

type: int

TCP port for daemon to occupy.

config: serial

type: [null, string]

default: null

Serial number for the particular device represented by the daemon.

config: make

type: [null, string]

default: null

Make (manufacturer) for the particular device represented by the daemon.

config: model

type: [null, string]

default: null

Model (manufacturer part number) for the particular device represented by the daemon.

config: enable

type: boolean

default: true

Disable this daemon. The kind entry-point will not attempt to start this daemon.

config: log_level

type: {type="enum", name="level", symbols=["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]}

default = "info"

Set daemon log level. See YEP-106 for a complete description of logging in yaq.

config: log_to_file

type: boolean

default: false

Optionally force logging to a file. See YEP-106 for a complete description of logging in yaq.

message: busy

response: boolean

Returns true if daemon is currently busy.

message: id

response: {'type': 'map', 'values': ['null', 'string']}

Map with information to identify the daemon, including name, kind, make, model, serial.

message: get_config_filepath

response: string

String representing the absolute filepath of the configuration file on the host machine.

message: get_config

response: string

Full configuration for the individual daemon as defined in the TOML file. This includes defaults and shared settings not directly specified in the daemon-specific TOML table.

message: shutdown

parameter: restart: boolean
parameter: restart: default: false

Cleanly shutdown (or restart) daemon.

message: get_state

response: string

Daemon state toml file dumped as a as string.

Copyright

This document is placed in the public domain or under the CC0-1.0-Universal license, whichever is more permissive.


built 2023-10-10 23:52:42                                      CC0: no copyright