mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2025-12-23 17:50:18 -06:00
* feat: snippets * feat: first couple paragraphs * feat: flesh out hatchet examples * fix: one more * feat: log view * fix: cleanup * feat: another section * fix: fmt * feat: debugging section * fix: proofread * fix: lint * chore: gen * fix: copilot * fix: copilot * feat: add blog post link * fix: feedback * chore: sdk ver * chore: gen * fix: ugh
26 lines
513 B
Python
26 lines
513 B
Python
# > Simple
|
|
|
|
from hatchet_sdk import Context, EmptyModel, Hatchet
|
|
|
|
hatchet = Hatchet(debug=True)
|
|
|
|
|
|
@hatchet.task()
|
|
def simple(input: EmptyModel, ctx: Context) -> dict[str, str]:
|
|
return {"result": "Hello, world!"}
|
|
|
|
|
|
@hatchet.durable_task()
|
|
def simple_durable(input: EmptyModel, ctx: Context) -> dict[str, str]:
|
|
return {"result": "Hello, world!"}
|
|
|
|
|
|
def main() -> None:
|
|
worker = hatchet.worker("test-worker", workflows=[simple, simple_durable])
|
|
worker.start()
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|