Module vweb.sse stdlib

vweb.sse
Version:
0.3.3
License:
MIT
Dependencies from vmod:
0
Imports:
3
Imported by:
0
Repository:
OS-specific
Show selected OS-specific symbols.
Backend-specific
Show selected Backend-specific symbols.

Dependencies defined in v.mod

This section is empty.

Imports

Imported by

This section is empty.

Aliases

This section is empty.

Constants

This section is empty.

Sum types

This section is empty.

Functions

#fn new_connection

fn new_connection(conn &net.TcpConn) &SSEConnection

Structs

#struct SSEConnection

heap
pub struct SSEConnection {
pub mut:
	headers       map[string]string
	conn          &net.TcpConn  = unsafe { nil }
	write_timeout time.Duration = 600 * time.second
}

#fn (&SSEConnection) start

fn (mut sse &SSEConnection) start() !

sse_start is used to send the start of a Server Side Event response.

#fn (&SSEConnection) send_message

fn (mut sse &SSEConnection) send_message(message SSEMessage) !

send_message sends a single message to the http client that listens for SSE.

It does not close the connection, so you can use it many times in a loop.

#struct SSEMessage

pub struct SSEMessage {
	id    string
	event string
	data  string
	retry int
}

Interfaces

This section is empty.

Enums

This section is empty.