code: def capacity(self):
          
          if not self._capacity:
              def cache_capacity(f):
                  self._capacity = f.result()
                  return f.result()
  
              return self._encode_invoke(ringbuffer_capacity_codec).continue_with(cache_capacity)
          return ImmediateFuture(self._capacity)
docs: Returns the capacity of this Ringbuffer.
  
          :return: (long), the capacity of Ringbuffer.