jchannel.types

exception StateError

Indicates that an operation could not be performed because the performer is in an invalid state.

For example, a message could not be sent because the server is not connected.

exception FrontendError

Indicates that an operation could not be performed in the frontend.

Contains a simple message or the string representation of a frontend exception.

class MetaGenerator

Provides generators to read a frontend stream.

async join()

Convenience method that joins all chunks into one.

Returns:

The joined stream chunks.

Return type:

bytes

async by_limit(limit=8192)

Provides chunks with maximum size limit.

Parameters:

limit (int) – The size limit.

Returns:

An async generator of stream chunks.

Return type:

async_generator[bytes]

async by_separator(separator='\n')

Provides chunks according to a separator.

Parameters:

separator (str or bytes) – The split separator. If a string, it is encoded as UTF-8.

Returns:

An async generator of stream chunks.

Return type:

async_generator[bytes]