datavis-tech / topologica

Minimal library for reactive dataflow programming. Based on topological sort.
MIT License
51 stars 1 forks source link

async/await support #54

Open hiroshi-yamamoto-dublr opened 2 years ago

hiroshi-yamamoto-dublr commented 2 years ago

This library is exactly what I was looking for, but almost all the properties I need to calculate and set in my dataflow graph are calculated using async functions. It's a shame you have to break these functions into two pieces, "cutting the dependency graph", as shown in the docs. Why not accept both async functions / promises and synchronous functions? The DAG can be scheduled in the same way, topologically.

curran commented 2 years ago

It's a great idea! If you can get it working, I would welcome a pull request that adds this feature.

curran commented 2 years ago

You may also like https://github.com/observablehq/runtime which supports promises.

hiroshi-yamamoto-dublr commented 2 years ago

Apologies but I went with another library already, and wouldn't have the bandwidth to go back and add this to topologica. I like what you built, however.

curran commented 2 years ago

Oh nice! I'm curious, what library did you end up going with?

lveillard commented 1 year ago

Up! This would be an amazing feature

curran commented 1 year ago

Thanks! I wonder what that would look like... The next step would be to come up with some failing test cases that outline the API we want to see.

hiroshi-yamamoto-dublr commented 1 year ago

@curran I went with this one. It handles async code just fine, and schedules as many async work units as possible to be run concurrently in the current "wave" of change propagation.

https://github.com/lukehutch/tiny-reactive-dataflow

curran commented 1 year ago

Oh wow very nice!