Module: Prosody::NativeDequeOperations
- Included in:
- NativeJsonDequeState, NativeMessageDequeState
- Defined in:
- lib/prosody/native_stubs.rb
Overview
Native deque keyed-state handle, vended by the context and wrapped by
DequeState. Every operation is fiber-yield async, except #scan,
which opens the cursor synchronously; each native cursor pull yields the
fiber.
Instance Method Summary collapse
-
#clear ⇒ void
Removes every element.
-
#commit ⇒ nil
Durably commits the buffered operations mid-handler.
-
#get(index) ⇒ Object?
Reads the element at front-relative position.
- #initialize ⇒ Object
-
#is_empty ⇒ Boolean
Whether the deque holds no live elements.
-
#len ⇒ Integer
The number of live elements.
-
#peek_back ⇒ Object?
Reads the back endpoint slot, or nil when empty.
-
#peek_front ⇒ Object?
Reads the front endpoint slot, or nil when empty.
-
#pop_back ⇒ Object?
Removes and returns the back element.
-
#pop_front ⇒ Object?
Removes and returns the front element.
-
#push_back(value) ⇒ void
Appends an element at the back.
-
#push_front(value) ⇒ void
Prepends an element at the front.
-
#rollback ⇒ nil
Discards the buffered uncommitted operations.
-
#scan(direction) ⇒ Object
Opens a native scan over the live elements.
Instance Method Details
#clear ⇒ void
This method returns an undefined value.
Removes every element.
794 795 796 |
# File 'lib/prosody/native_stubs.rb', line 794 def clear raise NotImplementedError, "This method is implemented natively in Rust" end |
#commit ⇒ nil
Durably commits the buffered operations mid-handler.
810 811 812 |
# File 'lib/prosody/native_stubs.rb', line 810 def commit raise NotImplementedError, "This method is implemented natively in Rust" end |
#get(index) ⇒ Object?
Reads the element at front-relative position.
736 737 738 |
# File 'lib/prosody/native_stubs.rb', line 736 def get(index) raise NotImplementedError, "This method is implemented natively in Rust" end |
#initialize ⇒ Object
714 715 716 |
# File 'lib/prosody/native_stubs.rb', line 714 def initialize raise NotImplementedError, "This class is implemented natively in Rust" end |
#is_empty ⇒ Boolean
Whether the deque holds no live elements.
728 729 730 |
# File 'lib/prosody/native_stubs.rb', line 728 def is_empty raise NotImplementedError, "This method is implemented natively in Rust" end |
#len ⇒ Integer
The number of live elements.
721 722 723 |
# File 'lib/prosody/native_stubs.rb', line 721 def len raise NotImplementedError, "This method is implemented natively in Rust" end |
#peek_back ⇒ Object?
Reads the back endpoint slot, or nil when empty. Same endpoint-slot semantics as #peek_front.
753 754 755 |
# File 'lib/prosody/native_stubs.rb', line 753 def peek_back raise NotImplementedError, "This method is implemented natively in Rust" end |
#peek_front ⇒ Object?
Reads the front endpoint slot, or nil when empty. One round trip, no length read; an expired endpoint slot under a TTL yields nil even when live interior elements remain (a peek never searches inward).
745 746 747 |
# File 'lib/prosody/native_stubs.rb', line 745 def peek_front raise NotImplementedError, "This method is implemented natively in Rust" end |
#pop_back ⇒ Object?
Removes and returns the back element.
787 788 789 |
# File 'lib/prosody/native_stubs.rb', line 787 def pop_back raise NotImplementedError, "This method is implemented natively in Rust" end |
#pop_front ⇒ Object?
Removes and returns the front element.
780 781 782 |
# File 'lib/prosody/native_stubs.rb', line 780 def pop_front raise NotImplementedError, "This method is implemented natively in Rust" end |
#push_back(value) ⇒ void
This method returns an undefined value.
Appends an element at the back.
763 764 765 |
# File 'lib/prosody/native_stubs.rb', line 763 def push_back(value) raise NotImplementedError, "This method is implemented natively in Rust" end |
#push_front(value) ⇒ void
This method returns an undefined value.
Prepends an element at the front.
773 774 775 |
# File 'lib/prosody/native_stubs.rb', line 773 def push_front(value) raise NotImplementedError, "This method is implemented natively in Rust" end |
#rollback ⇒ nil
Discards the buffered uncommitted operations.
817 818 819 |
# File 'lib/prosody/native_stubs.rb', line 817 def rollback raise NotImplementedError, "This method is implemented natively in Rust" end |
#scan(direction) ⇒ Object
Opens a native scan over the live elements.
803 804 805 |
# File 'lib/prosody/native_stubs.rb', line 803 def scan(direction) raise NotImplementedError, "This method is implemented natively in Rust" end |