jobserver

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// ServerName is the name associated with this server. If blank, a random
	// name is generated by the NATS library.
	ServerName string
	// Port is the port on which the server will listen for connections. If
	// zero, a random available port is used.
	Port int
	// StartTimeout is the maximum time to wait for the server to become ready
	// to accept connections. If zero, the default timeout of 5 seconds is used.
	StartTimeout time.Duration
	// EnableLogging enables server logging.
	EnableLogging bool
	// InactivityTimeout is the maximum time to wait for a ping from a client
	// before automatically shutting down. If zero, the server will not shut
	// down automatically.
	InactivityTimeout time.Duration
	// NoListener disables the network listener, only allowing in-process
	// connections to be made to this server instead.
	NoListener bool
}

type Server

type Server struct {
	CacheStats *common.CacheStats // Cache statistics
	// contains filtered or unexported fields
}

func New

func New(opts *Options) (srv *Server, err error)

New initializes and starts a new NATS server with the provided options. The server only listens on the loopback interface.

func (*Server) ClientURL

func (s *Server) ClientURL() string

ClientURL returns the URL connection string clients should use to connect to this NATS server.

func (*Server) Connect

func (s *Server) Connect() (*client.Client, error)

Connect returns a client using the in-process connection to the server.

func (*Server) Shutdown

func (s *Server) Shutdown()

Shutdown initiates the shutdown of this server.

func (*Server) WaitForShutdown

func (s *Server) WaitForShutdown()

WaitForShutdown waits indefinitely for this server to have shut down.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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