Hi Pavel Great work. We would love help and contributions with the Scala DSL. I think we should ty to unify how you specify period / time as you suggest.
And I dont mind the trade off, so please continue your work. I am sure you will even be able to find other spots in the Scala DSL which could be improved. On Fri, Dec 17, 2010 at 10:55 PM, Pavel <pag...@gmail.com> wrote: > 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 > -- Claus Ibsen ----------------- FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/