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.

参数:
  • 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.

返回:

True if the specified action exists for the table, or if the Topic exists, False otherwise.

返回类型:

bool

示例

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')