src/threadButler/types

Search:
Group by:
Source   Edit  

Types

Property = enum
  startUp, shutDown, taskPoolSize
The fields on Server that can be set via a properties section Source   Edit  
Section = enum
  MessageTypes = "messageTypes", ## Section that defines all message-types that a threadServer can receive.
  Properties = "properties", ## Section for the various definable `Property`_ fields of a threadServer.
  Handlers = "handlers"      ## Section for all procs that handle the various message-types this threadServer can receive.
Source   Edit  
Server[Msg] = object
  hub*: ChannelHub           ## The ChannelHub. Set internally by threadButler
  msgType*: Msg              ## The Message-Wrapper-Type of all messages that this threadServer receives. Set internally by threadButler
  startUp*: seq[Event]       ## parameterless closures to execute before running the server
  shutDown*: seq[Event]      ## parameterless closures to execute after when the server is shutting down
  taskPoolSize*: int = 2     ## The number of threads in the threadPool that execute tasks. Needs to be at least 2 to have a functioning pool. It must because the thread of the threadServer gets counted as part of the pool but will not contribute to working through tasks.
  
Data representing a single threadServer Source   Edit  

Consts

PROPERTY_NAMES: HashSet[string] = (data: [(0, ""), (0, ""), (0, ""), (0, ""),
    (421724124, "shutDown"), (2137910324, "taskPoolSize"), (0, ""),
    (3374301767, "startUp")], counter: 3)
Source   Edit  
SECTION_NAMES: HashSet[string] = (data: [(2215548800, "handlers"),
    (3745620809, "messageTypes"), (0, ""), (0, ""), (1634820420, "properties"),
    (0, ""), (0, ""), (0, "")], counter: 3)
Source   Edit