def submit(czk)
      state = czk.zkrb_state    # check the state of the connection

      if @meth == :state        # if the method is a state call
        @rval = [state]         # we're done, no error
        return deliver!

      elsif state != ZOO_CONNECTED_STATE  # otherwise, we must be connected
        @error = state                    # so set the error
        return deliver!                   # and we're out
      end

      rc, *_ = czk.__send__(:"zkrb_#{@meth}", *async_args)
      
      if user_callback? or (rc != ZOK)  # async call, or we failed to submit it
        @rval = [rc]                    # create the repsonse
        deliver!                        # wake the caller and we're out
      end
    end
def submit(czk)
      state = czk.zkrb_state    # check the state of the connection

      if @meth == :state        # if the method is a state call
        @rval = [state]         # we're done, no error
        return deliver!

      elsif state != ZOO_CONNECTED_STATE  # otherwise, we must be connected
        @error = state                    # so set the error
        return deliver!                   # and we're out
      end

      rc, *_ = czk.__send__(:"zkrb_#{@meth}", *async_args)
      
      if user_callback? or (rc != ZOK)  # async call, or we failed to submit it
        @rval = [rc]                    # create the repsonse
        deliver!                        # wake the caller and we're out
      end
    end
this method is called by the event thread to submit the request
 passed the CZookeeper instance, makes the async call and deals with the results

 BTW: in case you were wondering this is a completely stupid
 implementation, but it's more important to get *something* working and
 passing specs, then refactor to make everything sane