Skip to content

Commit

Permalink
Update Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
antonmi committed May 25, 2024
1 parent 3ce04a6 commit 593b0b1
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 41 deletions.
111 changes: 70 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,55 +278,84 @@ The pipeline definition is:
"transform": {"counter": "args['counter'] + 1"}
},
{
"type": "clone",
"name": "clone",
"to": [
{
"type": "stage",
"name": "get-followers",
"service": {"name": "github", "function": "get_followers"},
"prepare": {"username": "args['username']"},
"transform": {"followers": "args['followers']"}
},
{
"type": "switch",
"prepare": {
"count": "length(args['followers'])",
"counter": "args['counter']",
"limit": "args['limit']"
"type": "composer",
"name": "clone-event",
"memo": null,
"service": {
"name": "clone-service",
"function": "clone"
},
"prepare": {
"event": "args",
"memo": "memo"
},
"compose": {
"events": "args['events']",
"memo": "args['memo']"
}
},
{
"type": "switch",
"condition": "if args['report'], do: \"output\", else: \"next-steps\"",
"branches": {
"output": [
{
"type": "stage",
"name": "print",
"service": {"name": "io-inspect", "function": "print"},
"prepare": {"value": "args"}
}
],
"next-steps": [
{
"type": "stage",
"name": "get-followers",
"service": {"name": "github", "function": "get_followers"},
"prepare": {"username": "args['username']"},
"transform": {"followers": "args['followers']"}
},
"condition": "if args['count'] > 0 && args['counter'] < args['limit'], do: \"branch1\", else: \"branch2\"",
"branches": {
"branch1": [
{
"type": "stage",
"name": "find-closest",
"service": {"name": "levenshtein", "function": "closest"},
"prepare": {"name": "args['username']", "names": "args['followers']"},
"transform": {"closest": "args['closest']"}
},
{
"type": "stage",
"name": "reassign-vars",
"transform": {"username": "args['closest']", "followers": "hidden"}
},
{
"type": "goto",
"to": "repeat",
"condition": "true"
}
],
"branch2": [{"type": "dead-end"}]
{
"type": "switch",
"prepare": {
"count": "length(args['followers'])",
"counter": "args['counter']",
"limit": "args['limit']"
},
"condition": "if args['counter'] > 0 && args['counter'] < args['limit'], do: \"continue\", else: \"done\"",
"branches": {
"continue": [
{
"type": "stage",
"name": "find-closest",
"service": {"name": "levenshtein", "function": "closest"},
"prepare": {"name": "args['username']", "names": "args['followers']"},
"transform": {"closest": "args['closest']"}
},
{
"type": "stage",
"name": "reassign-vars",
"transform": {"username": "args['closest']", "followers": "hidden"}
},
{
"type": "goto",
"to": "repeat",
"condition": "true"
}
],
"done": [{"type": "dead-end"}]
}
}
}
]
]
}
}
]
}

```
One can see several components here:
- "stage" - for calling of underlying services.
- "switch", "clone", "goto" for directing the "event".
- "composer" - for creating a copy for output.
- "switch" and "goto" for directing the "event".

Stages have the "prepare", "service", and "transform" sections.
For example the "get-user" component:
Expand Down
Binary file modified images/github-solution.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 593b0b1

Please sign in to comment.