Static
createConnects a worker to the mesh.
import { MeshFlow } from '@hotmeshio/hotmesh';
import Redis from 'ioredis';
import * as workflows from './workflows';
async function run() {
const worker = await MeshFlow.Worker.create({
connection: {
class: Redis,
options: { host: 'redis', port: 6379 },
},
taskQueue: 'default',
workflow: workflows.example,
});
await worker.run();
}
The Worker service Registers worker functions and connects them to the mesh, using the target backend provider/s (Redis, Postgres, NATS, etc).
Example