Constructor
new Reader(logger, label) → {apiRead.Reader}
| Name | Type | Description |
|---|---|---|
logger | object | the Task's log.Logger |
label | string | what the reads are for, named in the warning |
| Name | Type | Description |
|---|---|---|
anyFailed | boolean | A read did not answer, or could not be sent. |
sentCount | integer | How many reads were asked for, and how many of them did not answer. |
failedCount | integer |
- Source
- Type:
- apiRead.
Reader
Methods
json(req, requestId) → {dynamic}
The parsed body of req, or invalid when the read did not answer. Only a failed read returns invalid: an answered empty result is a body, so a caller can tell the two apart and stop rather than fall back to a guess.
| Name | Type | Description |
|---|---|---|
req | dynamic | the request AA, or invalid when it could not be built |
requestId | string | the pool request id, also the log's label |
- Source
the parsed body, or invalid
- Type:
- dynamic