postgresWorkflowStoreFactory function

WorkflowStoreFactory postgresWorkflowStoreFactory(
  1. String uri, {
  2. String schema = 'public',
  3. String namespace = 'stem',
  4. String? applicationName,
  5. TlsConfig? tls,
})

Implementation

WorkflowStoreFactory postgresWorkflowStoreFactory(
  String uri, {
  String schema = 'public',
  String namespace = 'stem',
  String? applicationName,
  TlsConfig? tls,
}) {
  return WorkflowStoreFactory(
    create: () async => PostgresWorkflowStore.connect(
      uri,
      schema: schema,
      namespace: namespace,
      applicationName: applicationName,
      tls: tls,
    ),
    dispose: (store) async {
      if (store is PostgresWorkflowStore) {
        await store.close();
      }
    },
  );
}