You can run the async code by importing AsyncQStash from qstash and awaiting the methods.
AsyncQStash
qstash
from qstash import QStash client = QStash("<QSTASH-TOKEN>") client.url_group.upsert_endpoints( url_group="my-url-group", endpoints=[ {"url": "https://my-endpoint-1"}, {"url": "https://my-endpoint-2"}, ], )
from qstash import QStash client = QStash("<QSTASH-TOKEN>") url_group = client.url_group.get("my-url-group") print(url_group.name, url_group.endpoints)
from qstash import QStash client = QStash("<QSTASH-TOKEN>") all_url_groups = client.url_group.list() for url_group in all_url_groups: print(url_group.name, url_group.endpoints)
from qstash import QStash client = QStash("<QSTASH-TOKEN>") client.url_group.remove_endpoints( url_group="my-url-group", endpoints=[ {"url": "https://my-endpoint-1"}, ], )
from qstash import QStash client = QStash("<QSTASH-TOKEN>") client.url_group.delete("my-url-group")
Was this page helpful?