stream

package
v0.0.0-...-e105d0e Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stream

type Stream[T any] struct {
	// contains filtered or unexported fields
}

Stream wraps a connect.ServerStream.

func NewStream

func NewStream[T any](ctx context.Context, st *connect.ServerStream[T]) *Stream[T]

newStream creates a new stream.

func (*Stream[T]) Close

func (s *Stream[T]) Close()

Close closes the stream.

func (*Stream[T]) Run

func (s *Stream[T]) Run() error

Run runs the stream. Run will block until the stream is closed.

func (*Stream[T]) Send

func (s *Stream[T]) Send(data *T)

Send sends data to this stream's connected client.

type StreamInterface

type StreamInterface[T any] interface {
	Send(data *T)
	Run() error
	Close()
}

Jump to

Keyboard shortcuts

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