Skip to content

crates/triggers: Support argument expansion with :all/:each - #842

Draft
joebonrichie wants to merge 1 commit into
mainfrom
coalesced-triggers-seq
Draft

crates/triggers: Support argument expansion with :all/:each#842
joebonrichie wants to merge 1 commit into
mainfrom
coalesced-triggers-seq

Conversation

@joebonrichie

Copy link
Copy Markdown
Contributor

Currently, trigger handlers execute once per matched path, this can be slow for trigger handlerss which support processing multiple args.

Introduce argument expansion which allows triggers to batch arguments

  • $(var) / $(var:each) - Execute handler per match
  • $(var:all) - Execute handler against batched matches

e.g. instead of
systemctl preset foo.service
systemctl preset bar.service
systemctl preset baz.service

Do:
systemctl preset foo.service bar.service baz.service

@joebonrichie

joebonrichie commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Alternative to #701, we get practically the same performance uplift with the systemctl preset handler changed to use :all

Currently, trigger handlers execute once per matched path, this can be
slow for trigger handlerss which support processing multiple args.

Introduce argument expansion which allows triggers to batch arguments

- $(var) / $(var:each) - Execute handler per match
- $(var:all) - Execute handler against batched matches

e.g. instead of
systemctl preset foo.service
systemctl preset bar.service
systemctl preset baz.service

Do:
systemctl preset foo.service bar.service baz.service
@joebonrichie
joebonrichie force-pushed the coalesced-triggers-seq branch from 83f4b5e to 9f0996b Compare August 4, 2026 13:50
@joebonrichie joebonrichie changed the title crates/triggers: Support trigger argument expansion with :all/:each crates/triggers: Support argument expansion with :all/:each Aug 4, 2026
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.

1 participant