Integrating Effects with Async Functions in Zero Setup
Bit of a weird one here:
So I'm currently in the process of setting up Zero, that means I have to setup an endpoint in my server, which is effect, that acts as the recepients of push from external, that looks like this (hono example from the docs)
Now this isn't the particular problem here, I would just wrap this in Effect.tryPromise I asume.
The problem is the createMutators which looks like this:
Now these are the functions that are called by the processor.
I would like these to be effects aswell so i can access my services in stuff here.
However the processor calls async functions instead of effects.
So my idea was to create a managed runtime so in create mutators it would be:
I was wondering if 1. there is a better solution to this, 2. if there are problems with this, because this is then a runtime within the runtime? which seems like something that should be avoided
So I'm currently in the process of setting up Zero, that means I have to setup an endpoint in my server, which is effect, that acts as the recepients of push from external, that looks like this (hono example from the docs)
Now this isn't the particular problem here, I would just wrap this in Effect.tryPromise I asume.
The problem is the createMutators which looks like this:
Now these are the functions that are called by the processor.
I would like these to be effects aswell so i can access my services in stuff here.
However the processor calls async functions instead of effects.
So my idea was to create a managed runtime so in create mutators it would be:
I was wondering if 1. there is a better solution to this, 2. if there are problems with this, because this is then a runtime within the runtime? which seems like something that should be avoided
