sse

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2023 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Tick

func Tick(broker Broker, notify func(context.Context, Broker), period time.Duration, stop chan os.Signal)

Types

type Broker

type Broker interface {
	http.Handler
	Notify(data []byte)
	HasClients() bool
}

type SseBroker

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

func NewSseBroker

func NewSseBroker() (broker *SseBroker)

func (*SseBroker) HasClients

func (sse *SseBroker) HasClients() bool

func (*SseBroker) Notify

func (sse *SseBroker) Notify(data []byte)

func (*SseBroker) ServeHTTP

func (sse *SseBroker) ServeHTTP(rw http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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