class Authenticated
Executes AUTH after the user has established a connection.
Nested Definitionsdef initialize(credentials, protocol = Async::Redis::Protocol::RESP2)
Create a new authenticated protocol.
Signaturecredentials
Array
The credentials to use for authentication.
protocol
Object
The delegated protocol for connecting.
def initialize(credentials, protocol = Async::Redis::Protocol::RESP2)
@credentials = credentials
@protocol = protocol
end
def client(stream)
Create a new client and authenticate it.
Implementationdef client(stream)
client = @protocol.client(stream)
client.write_request(["AUTH", *@credentials])
response = client.read_response
if response != "OK"
raise AuthenticationError, "Could not authenticate: #{response}"
end
return client
end
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4