Folks,

I have an idea for period DSL enhancement in camel-scala that I want to get
your feedback on.
And a proposed implementation in
https://issues.apache.org/jira/browse/CAMEL-3439

Basically, there are 3 goals
* Support more time units - milliseconds to weeks
* Allow mixed units in period spec: 3 hours 20 minutes 30 seconds
* Internally remove/minimize duplication, so that units and relevant
transformations are defined in one place. Current codebase has these in
  - Period
  - RichInt
  - Frequency
  - SDelayDefinition (not sure if DSL uses these methods)
  - SThrottleDefinition (not sure if DSL uses these methods)

My implementation has a price - it requires DSL to always use period spec in
parentheses, so that scala compiler knows exactly where its definition
starts and ends.
Practically, it means no changes to "delay", and extra "()" for "throttle",
e.g.
* throttle (3 per (1 second))
* throttle (3 per (1 minute 30 seconds))

So, for you scala DSL users, does it sound like a useful enhancement and
reasonable tradeoff?

Thanks,
Pavel

Reply via email to