Conversation
… into inmoov2-heart
… into inmoov2-heart
…robotlab into inmoov2-heart
…to inmoov2-heart
…to inmoov2-heart
…to inmoov2-heart
…to inmoov2-heart
…to inmoov2-heart
…to inmoov2-heart
…to inmoov2-heart
…to inmoov2-heart
…/myrobotlab into inmoov2-heart
…to inmoov2-heart-2
…to inmoov2-heart-2
…to inmoov2-heart-2
…to inmoov2-heart-2
…to inmoov2-heart-2
| // getPeerName("python"), "onPythonMessage")); | ||
| listeners.add(new Listener("publishProcessMessage", getPeerName("python"), "onPythonMessage")); | ||
|
|
||
| listeners.add(new Listener("publishProcessMessage", getPeerName("python"), "onPythonMessage")); |
There was a problem hiding this comment.
should the callback method be onProcessMessage ? to follow our normal convention ? we can refactor this to make it consistent at a later time.
| * Checks battery, flashes leds and processes all the configured checks in | ||
| * onHeartbeat at a regular interval | ||
| */ | ||
| public Heartbeat publishHeartbeat() { |
There was a problem hiding this comment.
this does break with convention a bit.. normally we'd have a publishHeartbeat(Heartbeat beat) ... that simply returns the Heartbeat passed... the code below here, could be handled in the heart thread itself instead.. and just invoking publishHeartbeat with the beat that it created in that cycle... just curious why the departure from that convention?
| } | ||
| } | ||
|
|
||
| public void enable() { |
There was a problem hiding this comment.
could this list be more dynamic, perhaps from the default inmoov plan instead of this enumerated list here?
|
|
||
| @Deprecated /* use startPeers */ | ||
| public void startAll() throws Exception { | ||
| startAll(null, null); |
There was a problem hiding this comment.
can we leave this in and have it call startPeers ?
| } | ||
|
|
||
| @Deprecated /* use startPeers */ | ||
| public void startAll(String leftPort, String rightPort) throws Exception { |
There was a problem hiding this comment.
similar to above, can we just have this call startPeers? leave this method in for convenience sake?
| } | ||
|
|
||
| public void startHeartbeat() { | ||
| addTask(1000, "publishHeartbeat"); |
There was a problem hiding this comment.
this time should be configurable or pulled out as a constant for the interval here..
In general this is the beginning of a much more structured approach of processing in python.
No longer fragile with name dependencies. No global vars at all except runtime.