Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 3 additions & 60 deletions docs/flows.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,7 @@ to the flow.
If we only use the `morning` component in our project, the `MorningRoutine` flow
graph would look like the following:

[mermaid, format="svg"]
----
flowchart TD
a(WAKE_UP)
b(selfcare::SHOWER)
c(selfcare::GET_DRESSED)
d(food::MAKE_COFFEE)
e(food::DRINK_COFFEE)
a --> b
b --> c
c --> d
d --> e
----
mermaid::morning_flow1.mmd[format="svg"]

The power of `flow` services comes when more than one component adds actions to
the flow. Flows can be extended by inserting additional actions with new
Expand Down Expand Up @@ -114,28 +102,7 @@ struct childcare {

The new steps are inserted into the existing `flow`​'s dependency graph:

[mermaid, format="svg"]
----
flowchart TD
a(WAKE_UP)
b(selfcare::SHOWER)
c(selfcare::GET_DRESSED)
d(food::MAKE_COFFEE)
e(food::DRINK_COFFEE)
a --> b
b --> c
c --> d
d --> e
f(food::MAKE_BREAKFAST)
g(food::EAT_BREAKFAST)
h(childcare::PACK_SCHOOL_LUNCHES)
i(childcare::SEND_KIDS_TO_SCHOOL)
d --> h
h --> e
e --> f
f --> g
g --> i
----
mermaid::morning_flow2.mmd[format="svg"]

Multiple independent components can add actions to the same `flow`. This is the
power of `flow` services, they can be extended by multiple independent
Expand All @@ -161,31 +128,7 @@ all without the `MorningRoutine` source code having known about the new
functionality. We can mix and match new components without modifying the
original source code.

[mermaid, format="svg"]
----
flowchart TD
a(WAKE_UP)
b(selfcare::SHOWER)
c(selfcare::GET_DRESSED)
d(food::MAKE_COFFEE)
e(food::DRINK_COFFEE)
a --> b
b --> c
c --> d
d --> e
f(food::MAKE_BREAKFAST)
g(food::EAT_BREAKFAST)
h(childcare::PACK_SCHOOL_LUNCHES)
i(childcare::SEND_KIDS_TO_SCHOOL)
d --> h
h --> e
e --> f
f --> g
g --> i
j(exercise::RIDE_STATIONARY_BIKE)
a --> j
j --> b
----
mermaid::morning_flow3.mmd[format="svg"]

The `cib` library will take care of initializing and building all services,
including `flow` services. For `flow`​s, this means the dependency graph will be
Expand Down
22 changes: 1 addition & 21 deletions docs/intro.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,4 @@ _cib_ contains several parts that work together:
Various sub-libraries within CIB form a dependency graph. `cib` is an omnibus
library that contains all the functionality.

[mermaid, format="svg"]
----
flowchart BT
nexus(cib_nexus)
log(cib_log)
match(cib_match)
lookup(cib_lookup)

flow(cib_flow) --> nexus
flow --> log

log_fmt(cib_log_fmt) --> log
msg(cib_msg) --> log & match
msg --> lookup

log_binary(cib_log_binary) --> msg
seq(cib_seq) --> flow

interrupt(cib_interrupt)
cib --> seq & log_fmt & log_binary & interrupt
----
mermaid::library_deps.mmd[format="svg"]
18 changes: 18 additions & 0 deletions docs/library_deps.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
flowchart BT
nexus(cib_nexus)
log(cib_log)
match(cib_match)
lookup(cib_lookup)

flow(cib_flow) --> nexus
flow --> log

log_fmt(cib_log_fmt) --> log
msg(cib_msg) --> log & match
msg --> lookup

log_binary(cib_log_binary) --> msg
seq(cib_seq) --> flow

interrupt(cib_interrupt)
cib --> seq & log_fmt & log_binary & interrupt
10 changes: 10 additions & 0 deletions docs/morning_flow1.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
flowchart TD
a(WAKE_UP)
b(selfcare::SHOWER)
c(selfcare::GET_DRESSED)
d(food::MAKE_COFFEE)
e(food::DRINK_COFFEE)
a --> b
b --> c
c --> d
d --> e
19 changes: 19 additions & 0 deletions docs/morning_flow2.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
flowchart TD
a(WAKE_UP)
b(selfcare::SHOWER)
c(selfcare::GET_DRESSED)
d(food::MAKE_COFFEE)
e(food::DRINK_COFFEE)
a --> b
b --> c
c --> d
d --> e
f(food::MAKE_BREAKFAST)
g(food::EAT_BREAKFAST)
h(childcare::PACK_SCHOOL_LUNCHES)
i(childcare::SEND_KIDS_TO_SCHOOL)
d --> h
h --> e
e --> f
f --> g
g --> i
22 changes: 22 additions & 0 deletions docs/morning_flow3.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
flowchart TD
a(WAKE_UP)
b(selfcare::SHOWER)
c(selfcare::GET_DRESSED)
d(food::MAKE_COFFEE)
e(food::DRINK_COFFEE)
a --> b
b --> c
c --> d
d --> e
f(food::MAKE_BREAKFAST)
g(food::EAT_BREAKFAST)
h(childcare::PACK_SCHOOL_LUNCHES)
i(childcare::SEND_KIDS_TO_SCHOOL)
d --> h
h --> e
e --> f
f --> g
g --> i
j(exercise::RIDE_STATIONARY_BIKE)
a --> j
j --> b
Loading