• Split up command into command, command_blocking, and command_looping.
    The original command no longer returns anything, which clarifies how it
    should be used in most cases. command_looping and command_blocking both
    return a command object.
    
    Also added a waiting CV to the Command object, though it is not used in
    command_blocking yet.
    Hayk Martirosyan authored
     
    Browse Code »
  • Now, there is only one callback for command(), and it returns a const
    reference to the Command object. The user is responsible for error
    checking using c.ok(), c.status(), and getting the reply with c.reply().
    This significantly cleans up the library code and the user code.
    
    Greatly refactored the data type specialization code in command.cpp.
    Hayk Martirosyan authored
     
    Browse Code »



  • utils/logger.[ch]pp gives a logger implementation based on ostringstream
    that is pretty nice. I took this from Stack Overflow and added some
    things to make syntax nicer. Changed all cout and cerr statements in
    Redox to be of the form logger.{debug/info/warning/error/fatal}() <<
    stuff. Arguments for non-printed statements are still evaluated. Gives a
    performance hit if we actually add statements on every callback and run
    speed tests. For most use cases, doesn't matter. For now, not including
    such low level output anyway. Would be nice to have a macro to leave
    out/include the low-level logs at compile-time.
    Hayk Martirosyan authored
     
    Browse Code »
  • Hayk Martirosyan authored
     
    Browse Code »
  • Implemented limited but useful binary data support without breaking the
    API. If the last character of the command is a ", look for the first ",
    and everything in between the quotes treat as binary data. Takes care of
    setting a key with a binary value. Not useful if there need to be
    multiple binary entries in one command, or for binary keys. Also need to
    be careful if the last character of the value actually needs to be a
    quote, in which case we need to quote the value.
    Hayk Martirosyan authored
     
    Browse Code »


  • Consolidated user callbacks into one, improved some logic.
    Hayk Martirosyan authored
     
    Browse Code »
  • Created an atomic_int connect_state that keeps track of not yet
    connected, connected, disconnected, and errors. Used to implement good
    error behavior when the server is down and you start() a Redox instance,
    or when the server goes down in the middle of running commands. Now,
    nothing should hang, but should return errors (or throw exceptions) when
    the server goes down.
    
    Also added hooks for a user connect/disconnect callback in the
    constructor, which is helpful for client programs.
    
    Added an example with three Redox clients in one thread.
    Hayk Martirosyan authored
     
    Browse Code »