hofstadter-io / hof

Framework that joins data models, schemas, code generation, and a task engine. Language and technology agnostic.
https://docs.hofstadter.io
Apache License 2.0
522 stars 37 forks source link

Does hof support run node in parallel? #358

Open lianggengdino opened 11 months ago

lianggengdino commented 11 months ago

I want to know does hof support run node in parallel? Like direktiv, it support Parallel State. If hof support parallel, how to use.

verdverm commented 11 months ago

Hof supports more parallel work out-of-the-box than cue or the Go API does

There are two problems generally when doing parallel CUE (both will eventually be fixed upstream)

  1. Values from different contexts cannot be used together, we use a singleton, so if you use our loaders and helpers, you'll get this for free.

  2. The CUE evaluator is not concurrency safe. You generally have to use a mutex to protect calls to cue Go SDK functions. value.Unify() and similar.

If you are using hof/flow, the basics are covered. Flow (our cue cmd) also has some building blocks for allowing you to control how that parallelism works.

Can you expand on what you are trying to do, and what parts of hof you are looking at to help with this?