incubator-s4-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leo Neumeyer (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (S4-5) Prototype app builder
Date Thu, 15 Dec 2011 04:37:30 GMT

    [ https://issues.apache.org/jira/browse/S4-5?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13169960#comment-13169960
] 

Leo Neumeyer commented on S4-5:
-------------------------------

Another round.

* Got rid of StreamMaker. Now it is a graph from PE to PE using an emit() method. I can easily
infer the stream from the graph, no need to create a stream element.

* Added fluent configuration to Trigger/Timer by creating some additional helper classes that
the user doesn't have to see. 

* I will try to do the stream wiring in the PEs using the Event type of the streams but I'm
not sure if it is possible.

{code:title=S4 Fluent API|borderStyle=dashed}
package org.apache.s4.fluent;

import java.util.concurrent.TimeUnit;

public class MyApp extends AppMaker {

    @Override
    protected void configure() {

        PEMaker pez, pey, pex;

        pez = addPE(PEZ.class);
        pez.withTrigger().fireOn(EventA.class).ifInterval(5, TimeUnit.SECONDS);
        pez.withCache().ofSize(1000).withDuration(3, TimeUnit.HOURS);

        pey = addPE(PEY.class).property("duration", 4).property("height", 99);
        pey.withTimerInterval(50, TimeUnit.MILLISECONDS);

        pex = addPE(PEX.class).property("keyword", "money");

        pey.emit(EventA.class).withKey("gender").to(pez);
        pex.emit(EventB.class).withKey("height").to(pez);
        pex.emit(EventB.class).withKey("age").to(pey).to(pez);
    }
}
{code} 

                
> Prototype app builder
> ---------------------
>
>                 Key: S4-5
>                 URL: https://issues.apache.org/jira/browse/S4-5
>             Project: Apache S4
>          Issue Type: New Feature
>    Affects Versions: 0.5
>            Reporter: Leo Neumeyer
>            Priority: Minor
>             Fix For: 0.5
>
>
> Extend Guice AbstractModule to create a simple application builder layer. The idea is
to evaluate if we can use Guice to do all the wiring including PEs and Streams and Apps.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message