Beanstalkd: add FSM diagram for connections

Created on 19 Aug 2019  路  4Comments  路  Source: beanstalkd/beanstalkd

IMG_8252

Not sure that it has much of use really. Just created while was exploring sources.

Should we add it to sources as an ASCII diagram?

Most helpful comment

                             +--------+             +-----------+
        +-------------------->  WAIT  +------------>+  SENDJOB  |
        |                    +----+---+             +-----+-----+
        |                         |                       |
        |                         |                       |
        |                         |                       |
+-------+-------+           +-----v------+           +----v-----+         +--------+
|  WANTCOMMAND  +----------->  SENDWORD  +----------->  CLOSED  +-------->+  DONE  |
+-------+-------+           +-----+------+           +----+-----+         +--------+
        |                         ^                       ^
        |                         |                       |
        |                   +-----+------+                |
        +------------------->  WANTDATA  +----------------+
        |                   +------------+                |
        |                                                 |
        |                                                 |
        |                   +-------------+               |
        +------------------->  BITBUCKET  +---------------+
                            +-------------+

All 4 comments

How about as a dot file? This input file generates this image:

beanstalkfsm.txt
beanstalkfsm

                                       +--->  SENDJOB  +----------------------------+
                         +--------+    |   +-----------+                            |
        +---------------->  WAIT  +----+                                            |
        |                +--------+    |                                            |
        |                              +---------+                                  |
        |                                        |                                  |
        |                                        |                                  |
        |                                        |                                  |
        |                                        |                                  |
+-------+-------+                          +-----v------+                      +----v-----+       +--------+
|  WANTCOMMAND  +--------------------------+  SENDWORD  +---------------------->  CLOSED  +------->  DONE  |
+-------+-------+                          +-----+------+                      +----+-----+       +--------+
        |                                        ^                                  ^
        |                                        |                                  |
        |                                        |                                  |
        |                                        |                                  |
        |                                        |                                  |
        |                                  +-----+------+                           |
        +--------------------------------->+  WANTDATA  +---------------------------+
        |                                  +------------+                           |
        |                                                                           |
        |                                                                           |
        |                                                                           |
        |                                                                           |
        |                                  +-------------+                          |
        +--------------------------------->+  BITBUCKET  +--------------------------+
                                           +-------------+

@pseudocodes , nice job! Can you compress it a little so it will take less columns and rows?

                             +--------+             +-----------+
        +-------------------->  WAIT  +------------>+  SENDJOB  |
        |                    +----+---+             +-----+-----+
        |                         |                       |
        |                         |                       |
        |                         |                       |
+-------+-------+           +-----v------+           +----v-----+         +--------+
|  WANTCOMMAND  +----------->  SENDWORD  +----------->  CLOSED  +-------->+  DONE  |
+-------+-------+           +-----+------+           +----+-----+         +--------+
        |                         ^                       ^
        |                         |                       |
        |                   +-----+------+                |
        +------------------->  WANTDATA  +----------------+
        |                   +------------+                |
        |                                                 |
        |                                                 |
        |                   +-------------+               |
        +------------------->  BITBUCKET  +---------------+
                            +-------------+
Was this page helpful?
0 / 5 - 0 ratings

Related issues

ramSeraph picture ramSeraph  路  4Comments

Minnozz picture Minnozz  路  14Comments

vitlav picture vitlav  路  10Comments

tuuling picture tuuling  路  9Comments

kr picture kr  路  4Comments