def capacity(self):
if not self._capacity:<EOL><INDENT>def cache_capacity(f):<EOL><INDENT>self._capacity = f.result()<EOL>return f.result()<EOL><DEDENT>return self._encode_invoke(ringbuffer_capacity_codec).continue_with(cache_capacity)<EOL><DEDENT>return ImmediateFuture(self._capacity)<EOL>
Returns the capacity of this Ringbuffer.

:return: (long), the capacity of Ringbuffer.