Interface: tos.interfaces.ReadNow

interface ReadNow<typedef val_t>

The ReadNow interface is intended for split-phase low-latency reading of small values. The type of the value is given as a template argument. Because this interface is split-phase, these values may be backed by hardware. Providers of this interface should also provide a Resource interface, and this interface should only be used after the resource has been acquired. Otherwise, the low-latency requirement may be impossible to meet.

This interface has the same calling semantics as the Read interface described in TEP 114, except that it is async.

Parameters:
val_t - the type of the object that will be returned
Author:
Gilman Tolle <gtolle@archrock.com>
Version:
$Revision: 1.5 $ $Date: 2008/06/16 18:58:51 $

Commands
command error_t read() Initiates a read of the value.

Events
event void readDone(error_t result, val_t val) Signals the completion of the read().

Commands - Details

read

command error_t read()

Initiates a read of the value.

Returns:
SUCCESS if a readDone() event will eventually come back.

Events - Details

readDone

event void readDone(error_t result, val_t val)

Signals the completion of the read().

Parameters:
result - SUCCESS if the read() was successful
val - the value that has been read