go-sse: github.com/silalahi/go-sse Index | Files | Directories

package sse

import "github.com/silalahi/go-sse"

Index

Package Files

broker.go

type Broker Uses

type Broker struct {
    // Creating a map of client, keys are the channels which we can push message to client
    Clients map[chan string]bool
    // Channel of new client attached
    NewClient chan chan string
    // Channel of client that disconnected
    ClosedClient chan chan string
    // Channel of message to broadcast to clients
    Message chan string
}

Broker responsible for keeping a list of clients (browsers) and broadcast event

func NewBroker Uses

func NewBroker() (broker *Broker)

NewBroker return instance of broker

Directories

PathSynopsis
example

Package sse imports 1 packages (graph) and is imported by 1 packages. Updated 2017-08-22. Refresh now. Tools for package owners.