faust.agents.models

Models used by agents internally.

class faust.agents.models.ReqRepRequest(value, reply_to, correlation_id, *, __strict__=True, __faust=None, **kwargs) → None[source]

Value wrapped in a Request-Reply request.

value

Describes a field.

Used for every field in Record so that they can be used in join’s /group_by etc.

Examples

>>> class Withdrawal(Record):
...    account_id: str
...    amount: float = 0.0
>>> Withdrawal.account_id
<FieldDescriptor: Withdrawal.account_id: str>
>>> Withdrawal.amount
<FieldDescriptor: Withdrawal.amount: float = 0.0>
Parameters
  • field (str) – Name of field.

  • type (Type) – Field value type.

  • required (bool) – Set to false if field is optional.

  • default (Any) – Default value when required=False.

Keyword Arguments
  • model (Type) – Model class the field belongs to.

  • parent (FieldDescriptorT) – parent field if any.

reply_to
correlation_id
asdict()
class faust.agents.models.ReqRepResponse(value, correlation_id, key=None, *, __strict__=True, __faust=None, **kwargs) → None[source]

Request-Reply response.

key

Describes a field.

Used for every field in Record so that they can be used in join’s /group_by etc.

Examples

>>> class Withdrawal(Record):
...    account_id: str
...    amount: float = 0.0
>>> Withdrawal.account_id
<FieldDescriptor: Withdrawal.account_id: str>
>>> Withdrawal.amount
<FieldDescriptor: Withdrawal.amount: float = 0.0>
Parameters
  • field (str) – Name of field.

  • type (Type) – Field value type.

  • required (bool) – Set to false if field is optional.

  • default (Any) – Default value when required=False.

Keyword Arguments
  • model (Type) – Model class the field belongs to.

  • parent (FieldDescriptorT) – parent field if any.

value

Describes a field.

Used for every field in Record so that they can be used in join’s /group_by etc.

Examples

>>> class Withdrawal(Record):
...    account_id: str
...    amount: float = 0.0
>>> Withdrawal.account_id
<FieldDescriptor: Withdrawal.account_id: str>
>>> Withdrawal.amount
<FieldDescriptor: Withdrawal.amount: float = 0.0>
Parameters
  • field (str) – Name of field.

  • type (Type) – Field value type.

  • required (bool) – Set to false if field is optional.

  • default (Any) – Default value when required=False.

Keyword Arguments
  • model (Type) – Model class the field belongs to.

  • parent (FieldDescriptorT) – parent field if any.

correlation_id
asdict()