pgcomm

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PGComm added in v0.0.11

type PGComm struct {
	pb.UnimplementedPGServiceServer

	// Signal that all streaming API calls should stop
	StopAllStreaming chan bool
	// contains filtered or unexported fields
}

Implementation of the PGServer

func NewPGComm added in v0.0.11

func NewPGComm() *PGComm

func (*PGComm) AcceptStreamingAPICall added in v1.0.0

func (pgc *PGComm) AcceptStreamingAPICall() (*StreamingAPICall, error)

Blocks until a client connects or the server stops. Returns a StreamingAPICall for the new client, or an error if the server has stopped.

func (*PGComm) StartServing added in v0.0.11

func (pgc *PGComm) StartServing(addr string, port int, maxAPICalls int) error

Starts serving for gRPC calls at specified address and port.

func (*PGComm) StopServing added in v0.0.11

func (pgc *PGComm) StopServing()

Stops serving of gRPC calls.

func (*PGComm) StreamUpdates added in v0.0.11

func (pgc *PGComm) StreamUpdates(stream grpc.BidiStreamingServer[pb.PGUpdate, pb.PGUpdate]) error

Implementation of PGServer.StreamUpdates API call.

This function is invoked from a Go routine for each client that connects.

type StreamingAPICall added in v1.0.0

type StreamingAPICall struct {
	// Streaming data coming from the client App
	Inbound chan []byte

	// Streaming data going to the client App
	Outbound chan []byte

	// Signals that API call has exited
	CallHasExited chan byte
}

StreamingAPICall represents a single client streaming API call with channels for communication.

Jump to

Keyboard shortcuts

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