 INTEGER = 1
 BULK = 2
 MULTI = 3
+
+
+class Context
+  constructor: (@stream)->
+    this.reset()
+  reset: ->
+    @browser = new module.parent.exports.Browser(debug: debug)
 
 # Server-side of the Zombie protocol.
 # See http://redis.io/topics/protocol

    last = null
    # Queue next command to execute (since we're pipelining, we wait for
    # the previous command to complete and send its output first).
    queue = (stream, argv)->
      command = {}
      # Invoke this command.
      command.invoke = ->
        if fn = commands[argv[0]]
          console.log "Executing #{argv.join(" ")}" if debug
          argv[0] = command.reply
          fn.apply {}, argv
        else
          command.reply ERROR, "Unknown command #{argv[0]}"
      # Send a reply back to the client and if there's another command
      # in the queue, invoke it next.
      command.reply = (type, value)->
        respond stream, type, value
        last = command.next if last == command
        # Invoke next command in queue.
        if command.next

      # it's available.
      stream.setNoDelay true
      input = ""
      context = new Context(stream)
      stream.on "data", (chunk)->
        # Collect input and process as much as possible.
        input = process(context, input + chunk)
      stream.on "end", ->
        # Collect input and process as much as possible.
        process context, input

    # ## Processing

