Did you know ... Search Documentation:
Pack canny_tudor -- prolog/redis/tilde.pl
PublicShow source

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.

Example Usage

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.

author
- Roy Ratcliffe
version
- 1.0
license
- MIT
 ~>(+Request, -Reply) is semidet
Sends a request to the Redis server and retrieves the reply. Uses the Redis server specified in the settings.
Arguments:
Request- The request to send to the Redis server.
Reply- The reply received from the Redis server.
 ~ +PipeLine is det
Sends a pipeline of requests to the Redis server.
Arguments:
PipeLine- The pipeline of requests to send to the Redis server.