Skip to content

AlchemicalResponse

Bases: Generic[R]

An response to a queue item. While you can use this as a user, it is probably most useful for the tasks submodule.

Attributes:

Name Type Description
response_id int

the identifier of the response.

entry_id int

the identifier of the associated entry.

delivered_at datetime

when the response was submitted.

cleanup_at datetime | None

autoremove this response after this time.

data R

Response data.

Source code in src/alchemical_queues/main.py
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
class AlchemicalResponse(Generic[R]):
    """An response to a queue item. While you can use this as a user, it is probably most useful for the tasks submodule.

    Attributes:
        response_id (int): the identifier of the response.
        entry_id (int): the identifier of the associated entry.
        delivered_at (datetime): when the response was submitted.
        cleanup_at (datetime | None): autoremove this response after this time.
        data (R): Response data.
    """

    __slots__ = [
        "data",
        "entry_id",
        "response_id",
        "delivered_at",
        "cleanup_at",
    ]

    def __init__(
        self,
        response,
        data: R,
    ):
        self.response_id = response.response_id
        self.entry_id = response.entry_id
        self.delivered_at = response.delivered_at
        self.cleanup_at = response.cleanup_at
        self.data = data