Skip to content

Commit

Permalink
fix wotkflowDispatcher clear callback in stated-workflow.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Sergeev committed Feb 7, 2024
1 parent 55ce0c5 commit df990fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/workflow/StatedWorkflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class StatedWorkflow {
"publish": this.publish.bind(this),
"recover": this.recover.bind(this),
"logFunctionInvocation": this.logFunctionInvocation.bind(this),
//"workflow": StatedWorkflow.workflow.bind(this)
"workflow": this.workflow.bind(this)
}
};
this.templateProcessor = new TemplateProcessor(template, context);
Expand Down
7 changes: 5 additions & 2 deletions stated-workflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ import {WorkflowDispatcher} from "./src/workflow/WorkflowDispatcher.js";
(async () => {
//starts a single-user REPL session in its own dedicated process therefore replacing
//the static DEFAULT_FUNCTIONS won't have side effects
const {templateProcessor:tp} = await StatedWorkflow.newWorkflow()
const statedWorkflow = await StatedWorkflow.newWorkflow()
const {templateProcessor:tp} = statedWorkflow;
const repl = new StatedREPL(tp);
// FIXME: This is a workaround and probably should better be set in StatedWorkflow.newWorkflow()
repl.cliCore.onInit = WorkflowDispatcher.clear;

statedWorkflow.workflowDispatcher = new WorkflowDispatcher({});
repl.cliCore.onInit = statedWorkflow.workflowDispatcher.clear;
// TODO: stop the subscriber
// TODO:
await repl.initialize();
Expand Down

0 comments on commit df990fd

Please sign in to comment.