filter_callback
Creates a wrapper function that executes the provided callback only if the task specified in the message body is present in the allowed tasks list.
def filter_callback(
callback: function,
tasks: list
) - > function
Wraps a callback function to only execute if the incoming message's task name matches a specified whitelist.
Parameters
| Name | Type | Description |
|---|---|---|
| callback | function | The original message handler function to be executed if the task filter passes. |
| tasks | list | A collection of allowed task names used to filter incoming message bodies. |
Returns
| Type | Description |
|---|---|
function | A decorated version of the original callback that performs task-based filtering before execution. |