Events Development: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 5: Line 5:
=TODO=
=TODO=


<blockquote style="background-color: #f9f9f9; border: solid thin lightgrey;">
<pre>
:[[events TODO]]
doc/events TODO.docx
</blockquote>
</pre>


=Clone=
=Clone=
Line 29: Line 29:
<blockquote style="background-color: #f9f9f9; border: solid thin lightgrey;">
<blockquote style="background-color: #f9f9f9; border: solid thin lightgrey;">
:[[Public Release Procedure for Projects]]
:[[Public Release Procedure for Projects]]
</blockquote>[[Link title]]
</blockquote>


==Individual Unit Test==
==Individual Unit Test==

Latest revision as of 21:00, 28 April 2017

Internal

TODO

doc/events TODO.docx

Clone

git clone git@github.com:NovaOrdis/events.git

Development

Unnumbered Development Release

This will install a new unnumbered (same release number) "development" release locally:

cdevents
mvn clean install; ./bin/install -f

Numbered Release

Public Release Procedure for Projects

Individual Unit Test

mvn -Dmaven.surefire.debug="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5012" -Dtest=EventsApplicationRuntimeTest clean test

How to add New Commands

This is how you code new clad commands:

Clad User Manual

A few things to keep in mind:

  • The pipeline is initialized by the runtime, but there is no queue between the event processor and terminator. The command must install it.
  • The command executes on the main thread and might exit (and kill the JVM in the process) before the terminator had a chance to process its queue. Always register an EndOfStreamListerer with the terminator and wait on the main thread until that listener is notified.

Terminator terminator = runtime.getTerminator();

final CountDownLatch rendezVous = new CountDownLatch(1);

terminator.addEndOfStreamListener(new EndOfStreamListener() {
   @Override
   public void eventStreamEnded() {
        rendezVous.countDown();
    }
});

// ...

//
// wait until terminator finishes its queue
//
rendezVous.await();

or, better yet:

runtime.waitForEndOfStream();