| Did you know ... | Search Documentation: |
| Pack canny_tudor -- prolog/redis/tilde.pl |
This module provides operators for interacting with a Redis server
using the tilde syntax. The ~> operator is used to send a request
to the Redis server and retrieve a reply, while the ~ operator is
used to send a pipeline of requests.
The Redis server to use for these operations can be configured using
the server setting. By default, it is set to default, but it can
be changed to any valid Redis server identifier.
Read the current time from the Redis server and convert it to seconds:
?- [library(redis/tilde)]. ?- time ~> [S, US], Time is S + (US / 1e6).
The Redis TIME command returns the current server time as a two-element list, where the first element is the number of seconds since the epoch and the second element is the number of microseconds. The above example retrieves this information and calculates the total time in seconds.