sudoblockio / tackle

Tackle is a programmable configuration language for building modular utilities, code generators, and CLIs with schema validation baked in.
Apache License 2.0
53 stars 2 forks source link

Async Hook Calls #226

Open robcxyz opened 10 months ago

robcxyz commented 10 months ago

Async Hook Calls

Add async functionality to the parser

Overview

Would be cool to implement async functionality but would need another arrow to define the hook as being awaitable.


Greeter<-:

  target: str

  args: ['target']

  exec:

    print->: Hello {{target}}

tasks:

  - =>: Greeter world!

  - =>: Greeter earth!

  - =>: Greeter universe!

call->: await gather **tasks

Hooks are built via a partial method on the model which would need to be redefined via some async partial wrapper. Would need to move the partial method potentially