Acknowledge a streamer value as received from the remote side.
963919
def acknowledge_streamer(self, index, ack, force):
        """"""

        if index >= len(self.graph.streamers):
            return _pack_sgerror(SensorGraphError.STREAMER_NOT_ALLOCATED)

        old_ack = self.streamer_acks.get(index, 0)

        if ack != 0:
            if ack <= old_ack and not force:
                return _pack_sgerror(SensorGraphError.OLD_ACKNOWLEDGE_UPDATE)

            self.streamer_acks[index] = ack

        current_ack = self.streamer_acks.get(index, 0)
        return self._seek_streamer(index, current_ack)
610779
def set_receive_callback(self, callback, *args, **kwargs):
        """"""
        self.data_callback = callback
        self.data_callback_kwargs = kwargs
109898
private static void onDataRead(ChannelHandlerContext ctx, Http2DataFrame data) throws Exception {
        Http2FrameStream stream = data.stream();

        if (data.isEndStream()) {
            sendResponse(ctx, stream, data.content());
        } else {
            // We do not send back the response to the remote-peer, so we need to release it.
            data.release();
        }

        // Update the flowcontroller
        ctx.write(new DefaultHttp2WindowUpdateFrame(data.initialFlowControlledBytes()).stream(stream));
    }
385363
def acknowledge_wire(options = {})
      response = JSON.parse(@client.patch("items/#{send(:id)}/acknowledge_wire", options).body)
      @attributes = response['items']
      true
    end
1097046
function handleStream(remotePeerId, stream) {
    if (opened[remotePeerId] !== true) {
        stream.write("hello!")

        stream.on("data", log)
    }

    function log(data) {
        console.log("[PEER2]", remotePeerId, data)
    }
}
357776
def messageReceived(self, value, sender, target):
        
        if value.type != AMP_MESSAGE_TYPE:
            raise UnknownMessageType()
        inputBox = self._boxFromData(value.data)
        thunk = commandMethod.responderForName(self, inputBox[COMMAND])
        placeholder = _ProtocolPlaceholder(sender, target)
        arguments = thunk.command.parseArguments(inputBox, placeholder)
        try:
            result = thunk(**arguments)
        except tuple(thunk.command.errors.keys()), knownError:
            errorCode = thunk.command.errors[knownError.__class__]
            raise RevertAndRespond(
                Value(AMP_ANSWER_TYPE,
                         Box(_error_code=errorCode,
                             _error_description=str(knownError)).serialize()))
        else:
            response = thunk.command.makeResponse(result, None)
            return Value(AMP_ANSWER_TYPE, response.serialize())
523387
def streamserver_handle(cls, socket, address):
        ''''''
        request = cls.dummy_request()
        request._sock = socket
        server = None
        cls(request, address, server)
1252983
def activate_stream(self, stream_id, status):
        '''  '''
        req_hook = 'pod/v1/room/' + str(stream_id) + '/setActive?active=' + self.__rest__.bool2str(status)
        req_args = None
        status_code, response = self.__rest__.POST_query(req_hook, req_args)
        self.logger.debug('%s: %s' % (status_code, response))
        return status_code, response
1035156
def received_message(self, m):
        """"""

        # TODO: No support for binary messages
        m = str(m)
        logger.debug("Incoming upstream WS: %s", m)
        uwsgi.websocket_send(m)
        logger.debug("Send ok")
357794
def _wet_message_received(self, msg):
        """"""
        for callback in self._dry_wet_callbacks:
            callback(LeakSensorState.WET)
        self._update_subscribers(0x13)
592521
def on_receive(self, broker):
        """"""
        _vv and IOLOG.debug('%r.on_receive()', self)

        buf = self.receive_side.read()
        if not buf:
            return self.on_disconnect(broker)

        self._internal_receive(broker, buf)
1226298
function() {
            var val = element.oldValue = element.value
            if ($elem.data("duplex-observe") !== false) {
                evaluator(val)
                callback.call(element, val)
            }
        }
1243818
def receiver(self, value):
        """"""
        assert isinstance(value, Receiver)
        self.receiver_id = value.receiver_id
402847
def _send(self, **kwargs):
        
        if kwargs.get("dest_addr_long") is not None:
            self.zb.remote_at(**kwargs)
        else:
            self.zb.at(**kwargs)
774422
def handleIncomingReply(self, observer_name, reqId, frm, result,
                            numReplies):
        
        preparedReq = self._prepared.get((result[IDENTIFIER], reqId))
        if not preparedReq:
            raise RuntimeError('no matching prepared value for {},{}'.
                               format(result[IDENTIFIER], reqId))
        typ = result.get(TXN_TYPE)
        if typ and typ in self.replyHandler:
            self.replyHandler[typ](result, preparedReq)
811033
def trigger_streamer(self, index):
        """"""

        self._logger.debug("trigger_streamer RPC called on streamer %d", index)

        if index >= len(self.graph.streamers):
            return _pack_sgerror(SensorGraphError.STREAMER_NOT_ALLOCATED)

        if index in self._stream_manager.in_progress():
            return _pack_sgerror(SensorGraphError.STREAM_ALREADY_IN_PROGRESS)

        streamer = self.graph.streamers[index]
        if not streamer.triggered(manual=True):
            return _pack_sgerror(SensorGraphError.STREAMER_HAS_NO_NEW_DATA)

        self._logger.debug("calling mark_streamer on streamer %d from trigger_streamer RPC", index)
        self.graph.mark_streamer(index)

        self.process_streamers()

        return Error.NO_ERROR
1111553
def _receive_callback(self, raw_message):
        """"""
        message = self.backend.message_to_python(raw_message)
        if self.auto_ack and not message.acknowledged:
            message.ack()
        try:
            decoded = message.decode()
        except Exception, exc:
            if not self.on_decode_error:
                raise
            self.on_decode_error(message, exc)
        else:
            self.receive(decoded, message)