8000 Added Throttle component. by rybesh · Pull Request #23 · noflo/noflo · GitHub
[go: up one dir, main page]

Skip to content

Added Throttle component. - #23

Merged
bergie merged 1 commit into
noflo:masterfrom
rybesh:throttle
May 23, 2012
Merged

bergie merged 1 commit into
noflo:masterfrom
rybesh:throttle

Conversation

@rybesh
@rybesh rybesh commented May 22, 2012
Copy link
Copy Markdown
Contributor

This is a simple component that can be placed before another component that needs to be throttled lest the system run out of resources (memory, open files, etc). For example I use it with ReadFile as follows:

graph.addEdge "throttle", "out", "read file", "in"
graph.addEdge "read file", "load",  "throttle", "load"

This of course requires a modified ReadFile component that has a load out port. That is coming in a pending pull request.

bergie added a commit that referenced this pull request May 23, 2012
Added Throttle component.
@bergie
bergie merged commit 84786e1 into noflo:master May 23, 2012
AsherBond pushed a commit to AsherBond/noflo that referenced this pull request Oct 12, 2026
Convert code to coffeescript.
bergie added a commit that referenced this pull request Oct 19, 2026
#35 update #23's out-mapping semantics)

The two remaining unlocks of the noflo-jekyll FrontMatter substitution
(update #23 called the out-mapping semantics the single unlock; the
fence-matcher item shipped in noflo-yaml 2.0.0-alpha.2):

- assembly-utils ExtractField maps dot paths: the field name may carry
  segments (frontmatter.head), each walked as a plain own-property
  read. An absent segment at any level is the same malformed-message
  error the flat mapping reports, naming the full mapped path; arrays
  do not walk.
- assembly-utils CollectFields gains the spread mapping: a * field name
  in the fields config merges the inner output's keys into the
  message's top level — for inners whose output is a flat field map
  destined for the message (the parsed front matter), between the
  named-field nesting and the whole-message replace. The spread merges
  on top of the replace and the named fields, must be a plain object,
  and only one * is allowed.
- asAssembly validates the spread marker at wrap time and carries it
  into the generated collector's fields config.

Pinned by spec: the dot-path walk (flat, nested, deep, null values, the
absence shapes) and the spread semantics (merge, overwrite, precedence
over the named fields and the replace, the non-object error, the doubled
config), plus the wrap-time validation and the generated config.

End-to-end validation: the noflo-jekyll testbed's jekyll/FrontMatter
relay (76 lines, the custom front-matter split-and-parse) retires in
favor of wrapped yaml/ExtractFrontmatter + yaml/ParseYaml with the
nested-path extraction and the spread — the parity comparison against
the Jekyll-generated reference stays byte-identical and the stress loop
runs deterministic.
bergie added a commit that referenced this pull request Oct 19, 2026
…s errors (work document #35 update #23 review)

Two documented-invariant violations the #1106 review verified
by live probes, both in CollectFields' merge loop:

- The named fields and the spread merged together in connection order,
  so a same-key collision resolved by JS object key order — ['meta','*']
  let the spread win while ['*','meta'] let the named field win,
  contradicting the documented order-independence. The merge is now
  three passes — replace, named fields, spread — fixed by mapping kind,
  never by connection order.
- The spread's errors key interacted inconsistently with the error
  accumulation: silently discarded in the spread-only shape (the final
  overwrite), clobbering the whole accumulation in the replace+spread
  shape — a silent loss of diagnostics, the class the #48 no-silent-loss
  surface exists to surface. The spread now never owns errors: the
  errors key is excluded from the merge and the accumulation channels
  own the field, making both config shapes behave identically. The doc
  comment matches.

Plus the review's judgment call: an in-mapping value of '*' is rejected
at wrap time — the spread marker is out-mapping vocabulary, and the
in-side '*' would generate an extractor walking a literal '*' key and
failing at runtime.

Pinned: the connection-order independence (both config orders, same
result), the errors exclusion (both shapes, plus the error-port
append on the replace path under the terminal-event semantics), and the
wrap-time rejection. Suites: assembly-utils 47, assembly 49.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0