Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 7604 invoked from network); 21 Dec 2010 18:29:43 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 21 Dec 2010 18:29:43 -0000 Received: (qmail 4926 invoked by uid 500); 21 Dec 2010 18:29:43 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 4875 invoked by uid 500); 21 Dec 2010 18:29:42 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 4867 invoked by uid 99); 21 Dec 2010 18:29:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Dec 2010 18:29:42 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of pagrus@gmail.com designates 209.85.213.45 as permitted sender) Received: from [209.85.213.45] (HELO mail-yw0-f45.google.com) (209.85.213.45) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Dec 2010 18:29:36 +0000 Received: by ywl5 with SMTP id 5so2146607ywl.32 for ; Tue, 21 Dec 2010 10:29:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=bUPYVGsx1XA9O1RpHKyuyvTyxUirQJc93LPYqdL+P/I=; b=Tvy2c32uOrClVpgahSnz33cBnY9P+kXx1fjtBbXdLq08G27EkX/MgklpIWXFZCHknz 7TH/5cnDTlGuDpySjhAmuJokhwe6qOg3DyYLxkmh4EF+Pqs4z17CmYznHsZ2hwCkiENm uxOs1Gm9/kaoY3qMKPa72RHzP13p03UBEdxHo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=fZ08s+8AIA01P3ASt5KUscILzjxPKF8DL7/eOFzG8tRmrtkM0BQw83W1G8TL4eVdwu hSLY2WgC02TwZVYWRFASAzKYW6f8tFUhoy4I8gBdoj+K3DB/JIYVyb0efP5r2FAFEQzt vnE9CSrQ3SPsO4DVnlG7gApgDalRGhKbtT3+k= MIME-Version: 1.0 Received: by 10.236.108.43 with SMTP id p31mr11014207yhg.22.1292956155221; Tue, 21 Dec 2010 10:29:15 -0800 (PST) Received: by 10.236.102.148 with HTTP; Tue, 21 Dec 2010 10:29:15 -0800 (PST) In-Reply-To: References: Date: Tue, 21 Dec 2010 20:29:15 +0200 Message-ID: Subject: Re: Idea for camel-scala DSL enhancement. From: Pavel To: users@camel.apache.org Content-Type: multipart/alternative; boundary=90e6ba4fbe2e5799410497efd03c X-Virus-Checked: Checked by ClamAV on apache.org --90e6ba4fbe2e5799410497efd03c Content-Type: text/plain; charset=UTF-8 Cool; I guess then for this topic I'm missing a review from core committers (Gert, are you around?), so that I could address feedback. And propose docs then. IMO the next logical and handy DSL enhancement would be introduction of "every(period)", as alias for "from(timer:someGeneratedName?period=equivalentInMs)" Thanks, Pavel On Mon, Dec 20, 2010 at 8:20 AM, Claus Ibsen wrote: > 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 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: cibsen@fusesource.com > Web: http://fusesource.com > Twitter: davsclaus > Blog: http://davsclaus.blogspot.com/ > Author of Camel in Action: http://www.manning.com/ibsen/ > --90e6ba4fbe2e5799410497efd03c--