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

ASF GitHub Bot commented on QUARKS-217:
---------------------------------------

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

    https://github.com/apache/incubator-quarks/pull/156#discussion_r69611351
  
    --- Diff: 
samples/connectors/src/main/java/quarks/samples/connectors/iotf/IotfSensors.java
 ---
    @@ -119,20 +119,8 @@ public static void simulatedSensors(IotDevice device, 
boolean print) {
          * @param print true to print generated heartbeat tuples to System.out.
          */
         public static void heartBeat(IotDevice device, boolean print) {
    -        // In addition create a heart beat event to
    -        // ensure there is some immediate output and
    -        // the connection to IoTF happens as soon as possible.
    -        TStream<Date> hb = device.topology().poll(() -> new Date(), 1, 
TimeUnit.MINUTES);
    -        // Convert to JSON
    -        TStream<JsonObject> hbj = hb.map(d -> {
    -            JsonObject j = new  JsonObject();
    -            j.addProperty("when", d.toString());
    -            j.addProperty("hearbeat", d.getTime());
    -            return j;
    -        });
    -        if (print)
    -            hbj.print();
    -        device.events(hbj, "heartbeat", QoS.FIRE_AND_FORGET);
    +      HeartBeat.addHeartBeat(device, 1, TimeUnit.MINUTES,
    +          "heartbeat", stream -> { if (print) stream.print(); });
    --- End diff --
    
    Found the use of 'stream' a little confusing, since it's the tuple on the 
stream, not the stream itself.


> promote IoT device heart beat to a connector utility
> ----------------------------------------------------
>
>                 Key: QUARKS-217
>                 URL: https://issues.apache.org/jira/browse/QUARKS-217
>             Project: Quarks
>          Issue Type: New Feature
>          Components: Connectors
>            Reporter: Dale LaBossiere
>            Assignee: Dale LaBossiere
>            Priority: Minor
>
> Promote the IotDevice heart beat utility present in the IotSensors sample to 
> make it reusable.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to