• antirez's avatar
    Module: Ability to get context from IO context. · 152c1b68
    antirez authored
    It was noted by @dvirsky that it is not possible to use string functions
    when writing the AOF file. This sometimes is critical since the command
    rewriting may need to be built in the context of the AOF callback, and
    without access to the context, and the limited types that the AOF
    production functions will accept, this can be an issue.
    
    Moreover there are other needs that we can't anticipate regarding the
    ability to use Redis Modules APIs using the context in order to build
    representations to emit AOF / RDB.
    
    Because of this a new API was added that allows the user to get a
    temporary context from the IO context. The context is auto released
    if obtained when the RDB / AOF callback returns.
    
    Calling multiple time the function to get the context, always returns
    the same one, since it is invalid to have more than a single context.
    152c1b68
server.h 82.3 KB