Module: Hsdq::Connectors
Overview
This module contains the logic for different connection to the redis layer.
They can be connected to the same Redis instance, but it is recommended to use different database connections in order to segregate the different usages.
In production of large applications you should use different instances for the different layers. The configuration files are named after your class name hsdq_yourclass.yml
Instance Method Summary collapse
-
#cx_admin ⇒ Redis connection
establish a connection for the admin channel pub/sub.
-
#cx_data ⇒ Redis connection
Establish an unblocked connection for the sender and also pulling data from Redis.
-
#cx_listener ⇒ Redis connection
Establish the listener connection.
-
#cx_session ⇒ Redis connection
establish an unblocked connection for the session layer.
Instance Method Details
#cx_admin ⇒ Redis connection
establish a connection for the admin channel pub/sub
36 37 38 |
# File 'lib/hsdq/connectors.rb', line 36 def cx_admin @cx_admin ||= Redis.new cx_opts[:admin] end |
#cx_data ⇒ Redis connection
Establish an unblocked connection for the sender and also pulling data from Redis
24 25 26 |
# File 'lib/hsdq/connectors.rb', line 24 def cx_data @cx_data ||= Redis.new cx_opts[:message] end |
#cx_listener ⇒ Redis connection
Establish the listener connection. IMPORTANT this connection is blocked by the listener and must not be used elsewhere
17 18 19 |
# File 'lib/hsdq/connectors.rb', line 17 def cx_listener @cx_listener ||= Redis.new cx_opts[:message] end |
#cx_session ⇒ Redis connection
establish an unblocked connection for the session layer
30 31 32 |
# File 'lib/hsdq/connectors.rb', line 30 def cx_session @cx_session ||= Redis.new cx_opts[:session] end |