flownote
Version:
FlowNote lets developers create, organize, and reason about event-oriented applications with a simple flow-based language.
83 lines (60 loc) • 4.17 kB
Markdown

Channels are how Events are passed between Nodes and Milestones. Channels can be made to accept specificly named Events so you can control how Requests move through a flow.
If a Node or Milestone throws an exception and the preceding Channel had retry options set, the failed Event will be retried from its initial state a number times and with delays based on those options. When the retry options are exhausted, an Error Event will be sent to all connected Error Channels.
* `retry` can be a number of retries to attempt or a string of an Action name to use to generate a number of retries.returns a number.
* `retryDelay` can be a number of milliseconds to wait between retry attempts or a string of an Action name to use to generate a millisecond number.
This defines a Flow as a Node connecting to another Node.
```java
flow example(GET /example) = someNode -> anotherNode
```
This defines a Flow as a Node connecting to another Node with a custom reference. The referenced Node is then attached to the last Node.
```java
flow example(GET /example) = someNode -> anotherNode
customReference -> lastNode
```
This defines a Flow as a Node connecting to another Node with a custom reference. The referenced Node is then attached to the last Node via an Error Channel (!) that listens for `RangeErrors`.
Channel names can only be letters or numbers.
```java
flow example(GET /example) = someNode -> anotherNode
customReference -RangeError! lastNode
```
This defines a Flow as a Node connecting to another Node with a custom reference. The referenced Node is then attached to the last Node via an Named Channel that listens for `Named` events.
```java
flow example(GET /example) = someNode -> anotherNode
customReference -NamedChannel> lastNode
```
This defines a Flow as a Node connecting to another Node with a custom reference. The referenced Node is then attached to the last Node with retry options.
```java
flow example(GET /example) = someNode -> anotherNode
customReference -{ retry: 3, retryDelay: 3000 }> lastNode
```
This defines a Flow as a Node connecting to another Node with a custom reference. The referenced Node is then attached to the last Node with retry options set by returned results of an Action.
```java
flow example(GET /example) = someNode -> anotherNode
customReference -{ retry: someActionThatReturnsNumber, retryDelay: someActionThatReturnsMilliseconds }> lastNode
```
* [Programmatic example](https://github.com/Emblem21-OpenSource/flownote/blob/8957b98d719b2b0339e38006708156d493f951ce/tests/flowExamples.js#L81) of a Standard Channel.
* [Programmatic example](https://github.com/Emblem21-OpenSource/flownote/blob/8957b98d719b2b0339e38006708156d493f951ce/tests/flowExamples.js#L163) of an Error Channel.
* [Programmatic example](https://github.com/Emblem21-OpenSource/flownote/blob/8957b98d719b2b0339e38006708156d493f951ce/tests/flowExamples.js#L227) of a Retry Channel.
* [Programmatic example](https://github.com/Emblem21-OpenSource/flownote/blob/8957b98d719b2b0339e38006708156d493f951ce/tests/flowExamples.js#L300) of a Retry Channel defined by the results of an Action.
* [FlowNote example](https://github.com/Emblem21-OpenSource/flownote/blob/8957b98d719b2b0339e38006708156d493f951ce/tests/flowExamples.js#L419) of a Standard Channel.
* [FlowNote example](https://github.com/Emblem21-OpenSource/flownote/blob/8957b98d719b2b0339e38006708156d493f951ce/tests/flowExamples.js#L423) of an Error Channel.
* [FlowNote example](https://github.com/Emblem21-OpenSource/flownote/blob/8957b98d719b2b0339e38006708156d493f951ce/tests/flowExamples.js#L421) of a Retry Channel.
(
[](01-installation.md) |
[](02-features.md) |
[](03-use-cases.md) |
[](04-language.md) |
[](05-application.md) |
[](06-flow.md) |
[](07-nodes.md) |
Channels |
[](09-contribution.md) |
[](10-roadmap.md) |
[](11-known-problems.md)
)