.. index:: redis
.. _redis/0:

.. rst-class:: right

**object**

``redis``
=========

Redis client. Inspired by Sean Charles GNU Prolog Redis client.

| **Author:** Paulo Moura
| **Version:** 0:5:1
| **Date:** 2021-12-06

| **Compilation flags:**
|    ``static, context_switching_calls``


| **Provides:**
|    :ref:`logtalk::message_tokens//2 <logtalk/0::message_tokens//2>`
| **Uses:**
|    :ref:`list <list/0>`
|    :ref:`logtalk <logtalk/0>`

| **Remarks:**

   - Command representation: Use the Redis command name as the functor of a compound term where the arguments are the command arguments.
   - Valid arguments: Atoms, integers, and floats. Always use atoms instead of double-quoted "strings". This helps portability by not depending on the value of the ``double_quotes`` flag.

| **Inherited public predicates:**
|    (none)

.. contents::
   :local:
   :backlinks: top

Public predicates
-----------------

.. raw:: html

   <div id="connect/1"> </div>

.. index:: connect/1
.. _redis/0::connect/1:

``connect/1``
^^^^^^^^^^^^^

Connect to a Redis server running on localhost using the default 6379 port.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``connect(Connection)``
| **Mode and number of proofs:**
|    ``connect(--ground)`` - ``one``


------------

.. raw:: html

   <div id="connect/3"> </div>

.. index:: connect/3
.. _redis/0::connect/3:

``connect/3``
^^^^^^^^^^^^^

Connect to a Redis server running on the given host and port.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``connect(Host,Port,Connection)``
| **Mode and number of proofs:**
|    ``connect(+atom,+integer,--ground)`` - ``one``


------------

.. raw:: html

   <div id="disconnect/1"> </div>

.. index:: disconnect/1
.. _redis/0::disconnect/1:

``disconnect/1``
^^^^^^^^^^^^^^^^

Disconnect from a Redis server.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``disconnect(Connection)``
| **Mode and number of proofs:**
|    ``disconnect(++ground)`` - ``one``


------------

.. raw:: html

   <div id="send/3"> </div>

.. index:: send/3
.. _redis/0::send/3:

``send/3``
^^^^^^^^^^

Sends a request to the a Redis server and returns its reply

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``send(Connection,Request,Reply)``
| **Mode and number of proofs:**
|    ``send(++ground,++callable,--callable)`` - ``one``


------------

.. raw:: html

   <div id="console/1"> </div>

.. index:: console/1
.. _redis/0::console/1:

``console/1``
^^^^^^^^^^^^^

Sends a request to a Redis server running on localhost at the default 6379 port and prints the reply.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``console(Request)``
| **Mode and number of proofs:**
|    ``console(++callable)`` - ``one``


------------

Protected predicates
--------------------

(no local declarations; see entity ancestors if any)

Private predicates
------------------

(no local declarations; see entity ancestors if any)

Operators
---------

(none)

