// To integrate with @effect/cluster, you can use the
// `ClusterWorkflowEngine.layer` Layer, and provide it with your cluster Runner
// layer.
const WorkflowEngineLayer = ClusterWorkflowEngine.layer.pipe(
Layer.provideMerge(NodeClusterRunnerSocket.layer({ storage: 'sql' })),
Layer.provideMerge(
PgClient.layer({
database: 'effect_cluster',
username: 'cluster',
password: Redacted.make('cluster')
})
)
);
// const EnvLayer = Layer.mergeAll(
// EmailWorkflowLayer
// // You can add any other cluster entities or workflow layers here
// ).pipe(Layer.provide(WorkflowEngineLayer));
const EnvLayer = WorkflowEngineLayer
// Finally, you can execute a workflow using the `.execute` method.
EmailWorkflow.execute({ id: '123', to: 'hello@timsmart.co' }).pipe(Effect.provide(EnvLayer), NodeRuntime.runMain);
// To integrate with @effect/cluster, you can use the
// `ClusterWorkflowEngine.layer` Layer, and provide it with your cluster Runner
// layer.
const WorkflowEngineLayer = ClusterWorkflowEngine.layer.pipe(
Layer.provideMerge(NodeClusterRunnerSocket.layer({ storage: 'sql' })),
Layer.provideMerge(
PgClient.layer({
database: 'effect_cluster',
username: 'cluster',
password: Redacted.make('cluster')
})
)
);
// const EnvLayer = Layer.mergeAll(
// EmailWorkflowLayer
// // You can add any other cluster entities or workflow layers here
// ).pipe(Layer.provide(WorkflowEngineLayer));
const EnvLayer = WorkflowEngineLayer
// Finally, you can execute a workflow using the `.execute` method.
EmailWorkflow.execute({ id: '123', to: 'hello@timsmart.co' }).pipe(Effect.provide(EnvLayer), NodeRuntime.runMain);