Module rhino.util

Functions

call_with_ctx(fn, ctx, *args, **kw)

Call fn with or without 'ctx', depending on its signature.

If the fn callable accepts an argument named "ctx", then ctx will be passed as a keyword argument, else it will be ignored.

sse_event(event=None, data=None, id=None, retry=None, comment=None, encoding='utf-8')

Encode a Server-Sent Event (SSE).

At least one field must be present. All fields are strings, except retry, which should be an integer. The data and comment fields can contain newlines.