go_wsocket

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2023 License: MIT Imports: 8 Imported by: 0

README

go_wsocket

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WebSocket

type WebSocket struct {

	//canal de escucha de solicitudes nuevas.
	NEW_INCOMING_REQUESTS chan *model.Request

	// canal difusión de trabajos pendientes
	BROADCAST_RESPONSES chan *model.Request

	// canal para cerrar gorutinas en testing
	DONE chan bool
	// contains filtered or unexported fields
}

concentrador de solicitantes para websocket

func New

func New(buffer_size, concurrency_max int, allowed_origins ...string) *WebSocket

allowed_origins ej: "http://localhost", "http://127.0.0.1", "http://example.com", "https://example.com" buffer_size ej: 1024 concurrency_max Limitar la concurrencia de conexiones simultáneas ej 100

func (*WebSocket) ApplicantAdd

func (h *WebSocket) ApplicantAdd(applicants ...*model.Applicant)

func (*WebSocket) ApplicantRemove

func (hub *WebSocket) ApplicantRemove(a *model.Applicant)

func (*WebSocket) ServeHTTP

func (h *WebSocket) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*WebSocket) StartBroadcasting

func (h *WebSocket) StartBroadcasting(in <-chan *model.Request, done chan bool)

Jump to

Keyboard shortcuts

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