Returns the number of items in the queue. Returns: int: The number of items in the queue.
(self)
| 1018 | raise QueueEmpty('No items to remove from the queue') |
| 1019 | |
| 1020 | def size(self) -> int: |
| 1021 | """Returns the number of items in the queue. |
| 1022 | |
| 1023 | Returns: |
| 1024 | int: The number of items in the queue. |
| 1025 | |
| 1026 | """ |
| 1027 | op_type = DatastructureOperationType.QueueSize |
| 1028 | with ObservableRequestHandler(op_type, self._impl.observability_instruments) as ds_obs_handler: |
| 1029 | ds_obs_handler.create_kv_span(self._impl._request_builder._collection_dtls.get_details_as_dict()) |
| 1030 | kv_op_type = KeyValueOperationType.LookupIn |
| 1031 | with ObservableRequestHandler(kv_op_type, self._impl.observability_instruments) as obs_handler: |
| 1032 | op = count('') |
| 1033 | req, transcoder = self._impl.request_builder.build_lookup_in_request(self._key, |
| 1034 | (op,), |
| 1035 | obs_handler, |
| 1036 | parent_span=ds_obs_handler.wrapped_span) # noqa: E501 |
| 1037 | sd_res: LookupInResult = self._execute_op(self._impl.lookup_in, |
| 1038 | req, |
| 1039 | obs_handler, |
| 1040 | ds_obs_handler.wrapped_span, |
| 1041 | create_type=True, |
| 1042 | transcoder=transcoder) |
| 1043 | return sd_res.value[0].get('value', None) |
| 1044 | |
| 1045 | def clear(self) -> None: |
| 1046 | """Clears the queue. |
nothing calls this directly
no test coverage detected