Skip to content

Commit 3e92ad9

Browse files
committed
Rewrite Conf doc
1 parent 288dcb4 commit 3e92ad9

3 files changed

Lines changed: 80 additions & 44 deletions

File tree

README.md

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -25,41 +25,6 @@ Flor is a "Ruby workflow engine", if that makes any sense.
2525

2626
see [doc/](doc/).
2727

28-
## Running the specs
29-
30-
(Most of the time, as developer of flor, I'm writing specs, running them with `FLOR_DEBUG=dbg` and hammering the code until the specs are green. The following lines are about setting `FLOR_DEBUG` for flor development).
31-
32-
##### setting FLOR_DEBUG
33-
34-
This is a targetted run of a spec file:
35-
```
36-
FLOR_DEBUG=msg,err bundle exec rspec spec/punit/cancel_spec.rb
37-
```
38-
39-
* `msg` displays the flor messages in a summary, colored format
40-
* `err` displays errors with details, when and if they happen
41-
* `src` displays the source before it gets parsed and launched
42-
* `tree` displays the syntax tree as parsed from the source, right before launch
43-
* `run` shows info about each [run](doc/glossary.md#run) that just ended
44-
* `sto` displays debug information about the [storage](doc/glossary.md#storage), it's mostly SQL statements
45-
46-
#### `FLOR_DEBUG=dbg` and `FLOR_DEBUG=all`
47-
48-
There are two shortcuts for the flags above:
49-
```
50-
FLOR_DEBUG=dbg bundle exec rspec spec/punit/cancel_spec.rb
51-
# is equivalent to
52-
FLOR_DEBUG=msg,err,src,tree,run bundle exec rspec spec/punit/cancel_spec.rb
53-
```
54-
and
55-
```
56-
FLOR_DEBUG=all bundle exec rspec spec/punit/cancel_spec.rb
57-
# is equivalent to
58-
FLOR_DEBUG=msg,err,src,tree,run,log,sto bundle exec rspec spec/punit/cancel_spec.rb
59-
```
60-
61-
I tend to use `FLOR_DEBUG=dbg` when developping flor.
62-
6328

6429
## LICENSE
6530

doc/fragments.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
2+
# fragments.md
3+
4+
Fragments of documentation that will be reused later on.
5+
6+
---
7+
8+
9+
## Running the specs
10+
11+
(Most of the time, as developer of flor, I'm writing specs, running them with `FLOR_DEBUG=dbg` and hammering the code until the specs are green. The following lines are about setting `FLOR_DEBUG` for flor development).
12+
13+
##### setting FLOR_DEBUG
14+
15+
This is a targetted run of a spec file:
16+
```
17+
FLOR_DEBUG=msg,err bundle exec rspec spec/punit/cancel_spec.rb
18+
```
19+
20+
* `msg` displays the flor messages in a summary, colored format
21+
* `err` displays errors with details, when and if they happen
22+
* `src` displays the source before it gets parsed and launched
23+
* `tree` displays the syntax tree as parsed from the source, right before launch
24+
* `run` shows info about each [run](doc/glossary.md#run) that just ended
25+
* `sto` displays debug information about the [storage](doc/glossary.md#storage), it's mostly SQL statements
26+
27+
#### `FLOR_DEBUG=dbg` and `FLOR_DEBUG=all`
28+
29+
There are two shortcuts for the flags above:
30+
```
31+
FLOR_DEBUG=dbg bundle exec rspec spec/punit/cancel_spec.rb
32+
# is equivalent to
33+
FLOR_DEBUG=msg,err,src,tree,run bundle exec rspec spec/punit/cancel_spec.rb
34+
```
35+
and
36+
```
37+
FLOR_DEBUG=all bundle exec rspec spec/punit/cancel_spec.rb
38+
# is equivalent to
39+
FLOR_DEBUG=msg,err,src,tree,run,log,sto bundle exec rspec spec/punit/cancel_spec.rb
40+
```
41+
42+
I tend to use `FLOR_DEBUG=dbg` when developping flor.
43+

lib/flor/conf.rb

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,35 +27,63 @@ module Flor
2727

2828
module Conf
2929

30-
#
3130
# * uni_ unit prefix (or no prefix like for :env)
3231
# * sch_ scheduler prefix
3332
# * sto_ storage prefix
3433
# * exe_ executor prefix
3534
# * log_ logger prefix
3635
#
3736
#
37+
# * :uni_name
38+
# The name for the unit (Scheduler+Storage) pair.
39+
# The name must match the following regex: `/\A[a-zA-Z0-9_]+\z/`
40+
# Can also be set via the FLOR_UNIT environment variable.
41+
#
3842
# * :sch_heart_rate
39-
# defaults to 0.3s, checks for exids to run and timers to triggers
40-
# at least every 0.3s
43+
# Defaults to 0.3s, every 0.3s the scheduler checks its @wake_up and
44+
# @next_time fields to determine if it has to run (no db query)
45+
# @wake_up is set to true when there are incoming messages give to
46+
# this unit, @next_time simply holds the timestamp for the next timer
47+
# that has to trigger
4148
#
42-
# * :sch_reload_frequency
43-
# resync (reload) with db after how much time? (defaults to 60 (seconds))
49+
# * :sch_reload_after
50+
# reload/resync with db after how much time? (defaults to 60 (seconds))
51+
# minimizes communication with db in idle periods
4452
#
4553
# * :sch_max_executors
46-
# how many executor thread at most? (defaults to 7, 1 is OK in certain
54+
# How many executor thread at most? (defaults to 7, 1 is OK in certain
4755
# environments)
4856
#
4957
# * :exe_max_messages
50-
# how many messages will an executor run in a single session
51-
# (before quitting and passing the hand)
58+
# How many messages will an executor run in a single session
59+
# (before quitting and passing the hand) Defaults to 77
60+
# An executor will not run indefinitely as long as they are messages.
61+
# The goal is to prevent an execution from monopolizing an executor.
62+
#
63+
# And finally:
64+
#
65+
# * :flor_debug or :debug
66+
#
67+
# Usually set via the FLOR_DEBUG environment variable.
68+
# * `msg` displays the flor messages in a summary, colored format
69+
# * `err` displays errors with details, when and if they happen
70+
# * `src` displays the source before it gets parsed and launched
71+
# * `tree` displays the syntax tree as parsed from the source, right
72+
# before launch
73+
# * `run` shows info about each [run](doc/glossary.md#run) that just ended
74+
# * `sto` displays debug information about the
75+
# [storage](doc/glossary.md#storage), it's mostly SQL statements
76+
#
77+
# * `stdout` states that the debug messages must go to STDOUT
78+
# * `stderr` states that the debug messages must go to STDERR
5279
#
80+
# For example `debug: 'msg,stdout'`
5381

5482
def self.read(s)
5583

5684
h = {}
5785
h.merge!(Flor::ConfExecutor.interpret(s))
58-
h.merge!(interpret_flor_debug(h['flor_debug']))
86+
h.merge!(interpret_flor_debug(h['flor_debug'] || h['debug']))
5987

6088
h
6189
end

0 commit comments

Comments
 (0)