Module etcd-client.client.jsstream
JSON io interface over httpc io stream.
Instance methods
| instance.write (self, data[, timeout]) | Write a table to the stream. |
| instance.read (self[, timeout]) | Read a table from the stream. |
| instance.close (self) | Close the io stream. |
Module functions
| new (io) | Create a new JSON io instance. |
Instance methods
- instance.write (self, data[, timeout])
-
Write a table to the stream.
Parameters:
- self
JSON io instance.
- data
(table)
A table to encode and send via the JSON stream.
- timeout
(number,
optional)
Maximum waiting time for reading. The default value is 10s.
Returns:
- true on success
- false, error string on error
Raises:
errors if a param is invalid - self
- instance.read (self[, timeout])
-
Read a table from the stream.
Parameters:
- self
JSON io instance.
- timeout
(number,
optional)
Maximum waiting time for writing. The default value is 10s.
Returns:
- true, decoded table on success
- false, error string on error
Raises:
errors if a param is invalid - self
- instance.close (self)
-
Close the io stream.
The call do nothing if the stream is already closed.
Parameters:
- self
JSON io instance.
Returns:
-
nil
- self