This script demonstrates how to use the fleare client library to create a connection to a remote Fleare server instance, handle lifecycle events, and cleanly manage the connection lifecycle using an asynchronous pattern.
Sends a PING command to the server and receives a PONG response. Optionally, arguments can be passed which are echoed back after PONG .
This is commonly used to check if the server is responsive (like a health check or heartbeat).
The STATUS is used to retrieve the current state of the server, including server status, uptime, and detailed shard information. It helps users monitor the operational state of the server and its sharding configuration.
The EXISTS command is used to verify the existence of one or more keys in the database. It returns the count of keys that exist from the list provided.
The SESSION command returns the current session information for the authenticated client. It is typically used for diagnostics, auditing, or session lifecycle inspection.
The SET command is used to store a key-value pair in the database. If the key already exists, the value is overwritten. It is a common operation to persist data in memory Database.
The GET command retrieves the value associated with a given key from the in-memory database. If the value is a nested JSON object, an optional path can be provided to extract specific nested fields.
The DELETE command is used to remove a key-value pair from the in-memory database. It ensures the specified key is validated, removes it from the appropriate memory shard.