MCPcopy Index your code
hub / github.com/couchbase/couchbase-python-client / clear

Method clear

couchbase/datastructures.py:1045–1059  ·  view source on GitHub ↗

Clears the queue.

(self)

Source from the content-addressed store, hash-verified

1043 return sd_res.value[0].get('value', None)
1044
1045 def clear(self) -> None:
1046 """Clears the queue.
1047 """
1048 op_type = DatastructureOperationType.QueueClear
1049 with ObservableRequestHandler(op_type, self._impl.observability_instruments) as ds_obs_handler:
1050 ds_obs_handler.create_kv_span(self._impl._request_builder._collection_dtls.get_details_as_dict())
1051 kv_op_type = KeyValueOperationType.Remove
1052 with ObservableRequestHandler(kv_op_type, self._impl.observability_instruments) as obs_handler:
1053 try:
1054 req = self._impl.request_builder.build_remove_request(self._key,
1055 obs_handler,
1056 parent_span=ds_obs_handler.wrapped_span)
1057 self._impl.remove(req, obs_handler)
1058 except DocumentNotFoundException:
1059 pass
1060
1061 def __iter__(self):
1062 list_ = self._get()

Callers

nothing calls this directly

Calls 5

get_details_as_dictMethod · 0.80
build_remove_requestMethod · 0.80
create_kv_spanMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected