Adds a new item to the back of the queue. Args: value (JSONType): The value to push onto the queue.
(self, value: JSONType)
| 931 | transcoder=transcoder) |
| 932 | |
| 933 | def push(self, value: JSONType) -> None: |
| 934 | """Adds a new item to the back of the queue. |
| 935 | |
| 936 | Args: |
| 937 | value (JSONType): The value to push onto the queue. |
| 938 | |
| 939 | """ |
| 940 | op_type = DatastructureOperationType.QueuePush |
| 941 | with ObservableRequestHandler(op_type, self._impl.observability_instruments) as ds_obs_handler: |
| 942 | ds_obs_handler.create_kv_span(self._impl._request_builder._collection_dtls.get_details_as_dict()) |
| 943 | kv_op_type = KeyValueOperationType.MutateIn |
| 944 | with ObservableRequestHandler(kv_op_type, self._impl.observability_instruments) as obs_handler: |
| 945 | op = array_prepend('', value) |
| 946 | req = self._impl.request_builder.build_mutate_in_request(self._key, |
| 947 | (op,), |
| 948 | obs_handler, |
| 949 | parent_span=ds_obs_handler.wrapped_span) |
| 950 | self._execute_op(self._impl.mutate_in, |
| 951 | req, |
| 952 | obs_handler, |
| 953 | ds_obs_handler.wrapped_span, |
| 954 | create_type=True) |
| 955 | |
| 956 | def pop(self, timeout: Optional[timedelta] = None) -> Any: |
| 957 | """Removes an item from the front of the queue. |