rename node -> nodes
This commit is contained in:
parent
e962a6904c
commit
b6e37c4d47
@ -2,24 +2,20 @@ import { Node } from "@xyflow/react";
|
||||
import Bus from "./Bus";
|
||||
import { Emitter } from "mitt";
|
||||
|
||||
import nodes from "./node/";
|
||||
import * as nodes from "./nodes/";
|
||||
|
||||
export interface Iface {
|
||||
};
|
||||
|
||||
export class Impl implements Iface {
|
||||
_bus: Bus;
|
||||
_threads: Set<string>;
|
||||
|
||||
constructor(bus: Bus) {
|
||||
this._bus = bus;
|
||||
this._threads = new Set();
|
||||
}
|
||||
|
||||
_schedule(node: Node) {
|
||||
this._threads.add(node.id);
|
||||
run(this._bus, node).
|
||||
finally(()=>this._threads.delete(node.id));
|
||||
run(this._bus, node);
|
||||
}
|
||||
};
|
||||
|
||||
@ -46,6 +42,7 @@ async function execTask(bus: Bus, node: Node, aborted: Promise<void>) {
|
||||
const data: nodes.fetch.ToshoListedData = node.data;
|
||||
data;
|
||||
const sleep = new Promise(resolve => setTimeout(resolve, 1));
|
||||
// TODO
|
||||
await Promise.race([sleep, aborted]);
|
||||
bus.emit("onNodeRunning", { id: node.id, symbols: ["T/1234"], remaining: 32 });
|
||||
break;
|
||||
|
@ -12,15 +12,15 @@ import {
|
||||
applyNodeChanges,
|
||||
applyEdgeChanges,
|
||||
} from "@xyflow/react";
|
||||
import * as node from "./node/";
|
||||
import * as nodes from "./nodes/";
|
||||
|
||||
import "@xyflow/react/dist/style.css";
|
||||
|
||||
import Bus, { createBus, BusContext, Events } from "./Bus";
|
||||
|
||||
const nodeTypes = {
|
||||
fetch_ToshoListed: node.fetch.ToshoListed,
|
||||
present_TableDisplay: node.present.TableDisplay,
|
||||
fetch_ToshoListed: nodes.fetch.ToshoListed,
|
||||
present_TableDisplay: nodes.present.TableDisplay,
|
||||
};
|
||||
const initialNodes: Node[] = [
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user