server

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2022 License: Unlicense Imports: 9 Imported by: 0

README

b32svc

This is an example of a small concurrent handler for the back end of a microservice or similar.

Because the API of this example only has two functions, they are manually specified and the handlers are defined inline, but for a larger API, it would usually be done with the handler implementations separately defined, and then a generator to string the API specifications together and create an API handler that contains all the elements in this implementation.

The service defined here is written so as to be a library that can be pulled in by a separate concrete launch system, such as, for this case, usually would be a tty based service that runs under the control of systemd or similar.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(addr *net.TCPAddr, workers uint32) (b *b32)

New creates a new service handler

func NewWorkerPool

func NewWorkerPool(workers uint32, stop chan struct{}) *transcriber

NewWorkerPool initialises the data structure required to run a worker pool. Call Start to to initiate the run, and call the returned stop function to end it.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL