ssemux

package
v0.0.0-...-daf37b1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2016 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const CLOSED_CH_BUFFER = 16
View Source
const CLOSE_EVENT_FLAG = 0x1
View Source
const EVENT_CH_BUFFER = 16
View Source
const HEARTBEAT_INTERVAL = time.Second * 15

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	// SSE fields
	Comment string
	Id      string
	Event   string
	Data    string
	// sender source to exclude from dissemination
	Source string
	// internal flags
	Flag int
}

func NewCloseEvent

func NewCloseEvent() *Event

type MultiAssoc

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

func NewMultiAssoc

func NewMultiAssoc() *MultiAssoc

func (*MultiAssoc) Associate

func (ma *MultiAssoc) Associate(key string, assocKey string, syncStream *SyncStream)

func (*MultiAssoc) Disassociate

func (ma *MultiAssoc) Disassociate(key string, assocKey string)

func (*MultiAssoc) Event

func (ma *MultiAssoc) Event(assocKey string, event *Event)

type Store

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

func NewStore

func NewStore() *Store

func (*Store) Associate

func (s *Store) Associate(key string, assoc string, assocKey string) error

func (*Store) Event

func (s *Store) Event(assoc string, assocKey string, event *Event)

func (*Store) New

func (s *Store) New(key string) *Stream

type Stream

type Stream struct {
	EventCh chan *Event
	ResetCh chan bool
	// contains filtered or unexported fields
}

func NewStream

func NewStream(key string, closedCh chan string) *Stream

func (*Stream) Handle

func (s *Stream) Handle(w http.ResponseWriter)

type SyncStream

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

func NewSyncStream

func NewSyncStream(key string, stream *Stream) *SyncStream

func (*SyncStream) Associate

func (ss *SyncStream) Associate(multiAssoc *MultiAssoc, assocKey string)

func (*SyncStream) Disassociate

func (ss *SyncStream) Disassociate()

func (*SyncStream) Event

func (ss *SyncStream) Event(event *Event)

func (*SyncStream) Reset

func (ss *SyncStream) Reset(stream *Stream)

Jump to

Keyboard shortcuts

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