Skip to content

chatid/fend-redis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Redis Client for fend (https://github.com/chatid/fend)

Dependencies

Usage

All functions will throw a lua error if they encounter a problem. Modules can be required individually, or all will be available under redis = require "fend-redis"

###fend-redis

  • red = redis.add_sock ( dispatch , sock ) Adds a listener to the given dispatch for the connected redis socket sock

  • red:query ( callback , ... )
    Send a command to redis.
    Vararg is sent to fend-redis.construct
    When it is done: callback ( redisReply , err ) is called with the reply or callback ( nil , error_string ) in case of failure.

  • red:cmd ( ... )
    Send a command to redis; throw a lua error on failure.

###fend-redis.reply Adds a metatype to redisReply

  • value , str = myreply:toLua()
    Converts the reply to lua object value. For success or error replys, returns a descriptive string.

###fend-redis.reader A thin wrapper around the hiredis redisReader structure

  • myreader = reader.Create()
    Returns a redisReader object

  • myreader:Feed ( string )
    myreader:Feed ( buff , length )
    Copies data to the internal myreader buffer

  • myreader:GetReply ( )
    Parses data in the internal buffer, returning the next available redisReply
    Returns nil if no more complete replies found

  • myreader:GetReplies ( )
    Suitable for use as an iterator:

	print ( reply )
end```


###fend-redis.construct
This module returns a function that can construct a redis request.

eg, `construct ( "KEYS" , "*" )`

###fend-redis.fifo
Is the fifo library original from [lomp](https://github.com/daurnimator/lomp2/blob/master/fifo.lua)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages