exists_topic#
- swordfish.streaming.exists_topic(table_name: str, action_name: str) bool#
- swordfish.streaming.exists_topic(*, topic: Topic | str) bool
Checks if a specific action exists for a given StreamTable, or if a Topic exists.
- Parameters:
table_name (str, optional) – The name of the StreamTable.
action_name (str, optional) – The name of the action to check for.
topic (Union[Topic, str], optional) – The Topic to check for existence.
- Returns:
True if the specified action exists for the table, or if the Topic exists, False otherwise.
- Return type:
bool
Examples
- Check by table and action name:
>>> import swordfish as sf >>> sf.streaming.exists_topic('table_name', 'action_name')
- Check by topic name:
>>> import swordfish as sf >>> sf.streaming.exists_topic(topic='topic_name')