You can run the async code by importing Client from upstash_qstash.asyncio and awaiting the methods.
Client
upstash_qstash.asyncio
from upstash_qstash import Client client = Client("<QSTASH_TOKEN>") schedules = client.schedules() res = schedules.create({ "destination": "https://my-api...", "cron": "*/5 * * * *", }) print(res["scheduleId"])
from upstash_qstash import Client client = Client("<QSTASH_TOKEN>") schedules = client.schedules() schedules.create({ "destination": "https://my-api...", "cron": "0 * * * *", "callback": "https://my-callback...", "failure_callback": "https://my-failure-callback...", })
from upstash_qstash import Client client = Client("<QSTASH_TOKEN>") schedules = client.schedules() schedules.create({ "destination": "my-topic", "cron": "* * * * *", })
from upstash_qstash import Client client = Client("<QSTASH_TOKEN>") schedules = client.schedules() res = schedules.get("scheduleId") print(res["cron"])
from upstash_qstash import Client client = Client("<QSTASH_TOKEN>") schedules = client.schedules() all_scheds = schedules.list() print(all_scheds)
from upstash_qstash import Client client = Client("<QSTASH_TOKEN>") schedules = client.schedules() schedules.delete("scheduleId")
Was this page helpful?