Skip to content

Latest commit

 

History

History
188 lines (171 loc) · 8.71 KB

README.md

File metadata and controls

188 lines (171 loc) · 8.71 KB

Documentation


Callbags has three major layers.

  1. Producer Layer Sources:

This layer is responsible for sending data.

  1. Operator Layer Operators:

This layer is responsible for receiving data and do some operation, then sending data. So this layer is considered as producer layer too. The only difference is that it cannot send data without receiving them first.

  1. Consumer Layer Sinkers:

This layer is responsible for receiving data.

Visually represented as:

     required          optional         required
 ╭──────────────╮   ╭────────────╮   ╭────────────╮
 │              │<──│            │<──│            │
 │   Producer   │   │  Operator  │   │  Consumer  │
 │              │──>│            │──>│            │
 ╰──────────────╯   ╰────────────╯   ╰────────────╯

Note: each Callbags Layer has its own Architecture Design. However they share the following concept:

  1. Subscribe Stage:
  ╭────────────────────────╮  
  │ ╭────────────────────╮ │  
<─┼─│    request Start   │<┼── Handshake (required)
  │ ╰────────────────────╯ │  
  │       Only once        │  
  │ ╭────────────────────╮ │  
──┼>│    receive Start   ├─┼─> HandshakeBack (required)
  │ ╰────────────────────╯ │  
  ╰────────────────────────╯  
  1. Request/Receive Items Stage:
  ╭────────────────────────╮  
  │ ╭────────────────────╮ │  
<─┼─│    request Next    │<┼── WantItem (required for pullables)
  │ ╰────────────────────╯ │  
  │   As many as possible  │  
  │ ╭────────────────────╮ │  
──┼>│    receive Next    ├─┼─> TakeItem (optional)
  │ ╰────────────────────╯ │  
  ╰────────────────────────╯  
  1. Unsubscribe Stage:
  ╭────────────────────────╮  
  │ ╭────────────────────╮ │  
<─┼─│ request Completion │<┼── Bye (optional)
  │ ╰────────────────────╯ │  
  │       Only once        │  
  │ ╭────────────────────╮ │  
──┼>│ receive Completion ├─┼─> Bye/ByeBack (required)
  │ ╰────────────────────╯ │  
  ╰────────────────────────╯