---
feature_story: FS_97_64_39_94
feature_title: `token_bucket`-s
feature_status: TEST
---

# In short

There should be a way to:
*   limit consumption of args by the prev `envelope_container` (specifically to avoid default overrides)
*   while specifying search for the next `envelope_container`

# Idea

When 1st `data_envelope` is already singled out, user can place a delimiter char on the command line.

This delimiter should instruct:
> If envelope could be singled out by all the args until that delimiter,
> it should not consume args beyond that delimiter.

# Detailed problem description

If two `data_envelope`-s of the same class is required, there will be two sets of args from the same value spaces
(each instance will require same `prop_name`-s). Values consumable by the 1st `data_envelope` will also be
consumable by the 2nd `data_envelope`.

This is almost like TD_76_09_29_31 overlapped `prop_value`-s from diff `prop_name`-s
except that they are not from different `prop_name`-s.

The problem happens when search uses many defaults (via FS_72_40_53_00 `fill_control`) -
all these defaults applied on the 1st data envelope
will be overridable by args destined for the 2nd data envelope.

# Current solution

Each `envelope_container` can consume only from single `token_bucket`:

*   The 1st (ipos = 0) func `envelope_container` consumes from the 1st (ipos = 0) `token_bucket`.
*   Subsequent `envelope_container`-s consume each consume from the next `token_bucket` until there are more of them.
*   If there are no more `token_bucket`-s, subsequent `envelope_container`-s consume from the last `token_bucket`.

Note that the behavior without any `token_bucket` separator follows the same logic when all
`envelope_container`-s consume from the last `token_bucket` (the only one).

Note:

*   FS_26_43_73_72 func tree consumes as described above

*   FS_01_89_09_24 interp tree consumes only from the first (ipos = 0) `token_bucket`

    TODO: TODO_66_09_41_16: clarify command line processing
          This behaviour of interp tree consumption may change to respect bucket boundaries.

# Example

See `test_FS_97_64_39_94_token_buckets` in `test_relay_demo.py` - specifically how
`expected_container_ipos_to_used_token_bucket` is populated.

# Extensions

TODO: TODO_75_52_01_67: `token_bucket`-s to support multiple var args
