The MeshFlow Client service is functionally equivalent to the Temporal Client service. Start a new workflow execution by calling workflow.start. Note the direct connection to Postgres.

NATS can be used as the message broker if advanced messaging is required (i.e, patterned subscriptions).

//client.ts
import { Client, HotMesh } from '@hotmeshio/hotmesh';
import { Client as Postgres } from 'pg';

async function run(): Promise<string> {
const client = new Client({
connection: {
class: Postgres,
options: { connectionString: 'postgresql://usr:pwd@localhost:5432/db' }
}
});

const handle = await client.workflow.start({
args: ['HotMesh'],
taskQueue: 'default',
workflowName: 'example',
workflowId: HotMesh.guid()
});

return await handle.result();
//returns ['Hello HotMesh', '¡Hola, HotMesh!']
}

Properties

workflow: ClientWorkflow = ...

The MeshFlow Client service is functionally equivalent to the Temporal Client service. Starting a workflow is the primary use case and is accessed by calling workflow.start().

Methods

  • Any point of presence can be used to deploy and activate the HotMesh distributed executable to the active quorum.

    Parameters

    • namespace: string = APP_ID
    • version: string = APP_VERSION

    Returns Promise<void>