Documentation ¶
Overview ¶
Package sse implements a k6/x/sse javascript module extension for k6. It provides basic functionality to handle Server-Sent Event over http that *blocks* the event loop while the http connection is opened. [SSE API design document]: https://github.com/phymbert/xk6-sse/blob/master/docs/design/021-sse-api.md#proposed-solution
Index ¶
Constants ¶
const MetricEventName = "sse_event"
MetricEventName is the sse event metric of the module
Variables ¶
var ErrSSEInInitContext = common.NewInitContextError("using sse in the init context is not supported")
ErrSSEInInitContext is returned when sse are using in the init context
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the representation of the sse returned to the js.
type HTTPResponse ¶
type HTTPResponse struct { URL string `json:"url"` Status int `json:"status"` Headers map[string]string `json:"headers"` Error string `json:"error"` }
HTTPResponse is the http response returned by sse.open.
type RootModule ¶
type RootModule struct{}
RootModule is the global module instance that will create module instances for each VU.
func (*RootModule) NewModuleInstance ¶
func (*RootModule) NewModuleInstance(m modules.VU) modules.Instance
NewModuleInstance implements the modules.Module interface to return a new instance for each VU.