Github user manuzhang commented on a diff in the pull request:

    https://github.com/apache/incubator-gearpump/pull/6#discussion_r61362813
  
    --- Diff: docs/dev-write-1st-app.md ---
    @@ -55,13 +163,58 @@ object Split {
     }
     ```
     
    -Like Split, every processor extends a `TaskActor`.  The `onStart` method 
is called once before any message comes in; `onNext` method is called to 
process every incoming message. Note that Gearpump employs the message-driven 
model and that's why Split sends itself a message at the end of `onStart` and 
`onNext` to trigger next message processing.
    +</div>
    +
    +<div data-lang="java" markdown="1">
    +```java
    +public class Split extends Task {
    +
    +  public static String TEXT = "This is a good start for java! bingo! 
bingo! ";
    +
    +  public Split(TaskContext taskContext, UserConfig userConf) {
    +    super(taskContext, userConf);
    +  }
    +
    +  private Long now() {
    +    return System.currentTimeMillis();
    +  }
    +
    +  @Override
    +  public void onStart(StartTime startTime) {
    +    self().tell(new Message("start", now()), self());
    +  }
    +
    +  @Override
    +  public void onNext(Message msg) {
    +
    +    // Split the TEXT to words
    +    String[] words = TEXT.split(" ");
    +    for (int i = 0; i < words.length; i++) {
    +      context.output(new Message(words[i], now()));
    +    }
    +    self().tell(new Message("next", now()), self());
    +  }
    +}
    +```
    +
    +</div>
    +
    +</div>
    +
    +Essentially, each processor consists of two descriptions:
    +
    +1. A `Task` to define the operation.
    +
    +2. A parallelism level to define the parallelism of this processor. I.e. 
this processor will have how many tasks running in parallel. 
    --- End diff --
    
    => "A parallelism level to define the number of tasks of this processor to 
run in parallel."


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to