server

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PathCacheSize uint32 = 100

PathCacheSize determines how large the shared client-server path cache should be.

View Source
var ResultBufferSize uint32 = 50

ResultBufferSize determines how large the buffer for outgoing results should be.

Functions

This section is empty.

Types

type RootResolver

type RootResolver func(rctx *resolver.Context)

RootResolver is the root resolver call.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server serves sessions with clients. Clients keep a query tree in sync with the server.

func NewServer

func NewServer(schema *schema.Schema) *Server

NewServer builds a new server.

func (*Server) BuildSession

func (s *Server) BuildSession(ctx context.Context, sendCh ServerSendChan, rootRes RootResolver) *Session

BuildSession builds a new session.

type ServerSendChan

type ServerSendChan chan<- *proto.RGQLServerMessage

ServerSendChan is a channel used to send updates to a remote client. This should be sufficiently buffered, as internally resolver processing will halt until new messages are writable to the channel (after an internal buffer fills). The server will close this channel when it disposes the client instance for any reason.

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session is a client session container.

func NewSession

func NewSession(ctx context.Context, server *Server, sendCh ServerSendChan, rootRes RootResolver) *Session

NewSession builds a new session.

func (*Session) Cancel

func (s *Session) Cancel()

Cancel cancels the context for this client.

func (*Session) HandleMessage

func (s *Session) HandleMessage(msg *proto.RGQLClientMessage)

HandleMessage instructs the server to handle a message from a remote client.

Jump to

Keyboard shortcuts

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