Constructor
new QueueSpreading(graphSpreading)
import { QueueSpreading } from 'ancient-graph-spreading';
Parameters:
- Source:
Methods
_getGraph(linkId) → {Graph}
Should return graph instance by link id from process field.
Parameters:
Name |
Type |
Description |
linkId |
string
|
|
- Source:
Throws:
-
-
-
Type
-
Error
Returns:
-
Type
-
Graph
removeFromLaunched(launchedGraph, launchedLinkId, launchedToRemove)
Reacts to end of method triggered from launched or process link. If there are no other processes spreading links performed for the start, remove launched token.
Parameters:
Name |
Type |
Description |
launchedGraph |
ExistedGraph
|
|
launchedLinkId |
string
|
|
launchedToRemove |
string
|
|
- Source:
spreadByPath(pathGraph, pathLink, callbackopt)
Reacts to insert a new path and reacts to update launched remove unspread, but spread still exists. This method triggers the first step of the second spread queue.
If passed callback, then not be called removeFromLaunched.
Parameters:
Name |
Type |
Attributes |
Description |
pathGraph |
PathGraph
|
|
|
pathLink |
PathLink
|
|
Properties
Name |
Type |
Description |
launched |
Array.<string>
|
['spread'] |
|
callback |
function
|
<optional>
|
|
- Source:
spreadBySpread(spreadLink, callbackopt)
Reacts to insert new spread link. Link can be inserted with field process as step in queue or with field launched as start of queue.
If passed callback, then not be called removeFromLaunched.
Parameters:
Name |
Type |
Attributes |
Description |
spreadLink |
SpreadLink
|
|
|
callback |
function
|
<optional>
|
|
- Source:
spreadBySpreader(spreaderGraph, spreaderLink, callbackopt)
Reacts to insert a new spreader and reacts to update launched remove unspread, but spread still exists. This method triggers the first step of the second spread queue.
If passed callback, then not be called removeFromLaunched.
Parameters:
Name |
Type |
Attributes |
Description |
spreaderGraph |
SpreaderGraph
|
|
|
spreaderLink |
SpreaderLink
|
|
Properties
Name |
Type |
Description |
launched |
Array.<string>
|
['spread'] |
|
callback |
function
|
<optional>
|
|
- Source:
unspreadByPath(pathGraph, pathLink, callbackopt)
Reacts to remove path and reacts to update source or target in path. Then it launched two queues, unspread and spread. This method triggers the first step of the first unspread queue. After removal of unspread from launched from path, you need to start the second queue with method spreadByPath.
If passed callback, then not be called removeFromLaunched.
Parameters:
Name |
Type |
Attributes |
Description |
pathGraph |
PathGraph
|
|
|
pathLink |
PathLink
|
|
Properties
Name |
Type |
Description |
launched |
Array.<string>
|
['unspread', 'spread'] |
|
callback |
function
|
<optional>
|
|
- Source:
unspreadBySpread(spreadLink, callbackopt)
Reacts to remove spread link.
If passed callback, then not be called removeFromLaunched.
Parameters:
Name |
Type |
Attributes |
Description |
spreadLink |
SpreadLink
|
|
|
callback |
function
|
<optional>
|
|
- Source:
unspreadBySpreader(spreaderGraph, spreaderLink, callbackopt)
Reacts to remove spreader link and reacts to update source or target in spreader. Then it launched two queues, unspread and spread. This method triggers the first step of the first unspread queue. After removal of unspread from launched from spreader, you need to start the second queue with method spreadBySpreader.
If passed callback, then not be called removeFromLaunched.
Parameters:
Name |
Type |
Attributes |
Description |
spreaderGraph |
SpreaderGraph
|
|
|
spreaderLink |
SpreaderLink
|
|
Properties
Name |
Type |
Description |
launched |
Array.<string>
|
['unspread', 'spread'] |
|
callback |
function
|
<optional>
|
|
- Source: