edgent-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (QUARKS-217) promote IoT device heart beat to a connector utility
Date Tue, 12 Jul 2016 17:24:20 GMT

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

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

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

    https://github.com/apache/incubator-quarks/pull/156#discussion_r70481679
  
    --- 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 --
    
    actually it's really a stream... see the addHeartBeat() signature and javadoc.  but I
see the @param for the consumer is lacking text and will add that.


> 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)

Mime
View raw message