server

package
v0.0.0-...-2a45ea8 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package server implements a counterpart for serving incoming gRPC connections initiated by gRPC-based ReplicaConnector and connects it directly to an instance of MessageStreamHandler interface

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenAndServe

func ListenAndServe(s ReplicaServer, addr string, serverOpts ...grpc.ServerOption) error

ListenAndServe helps to start a server on a TCP address. It starts listening on a given TCP address and serving incoming connections.

Types

type ReplicaServer

type ReplicaServer interface {
	Serve(lis net.Listener, serverOpts ...grpc.ServerOption) error
	Stop()
}

ReplicaServer implements a gRPC server to serve incoming connections from ReplicaConnector of this package.

Server method serves incoming connection on the supplied listener. It blocks and returns either on error or if Stop method is called.

Stop method gracefully stops the server. It immediately closes all open connections and listeners.

func New

func New(replica api.ConnectionHandler) ReplicaServer

New creates a new instance of ReplicaServer using the specified replica instance to connect incoming requests with.

Jump to

Keyboard shortcuts

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