Module: Prosody::NativeMapOperations
- Included in:
- NativeJsonMapState, NativeMessageMapState
- Defined in:
- lib/prosody/native_stubs.rb
Overview
Native String-keyed ordered-map keyed-state handle, vended by the context and
wrapped by MapState. 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 entry.
-
#commit ⇒ nil
Durably commits the buffered operations mid-handler.
-
#contains_key(key) ⇒ Boolean
Answers whether a stored cell exists for a key.
-
#get(key) ⇒ Object?
Reads the value for a key.
-
#get_many(keys) ⇒ Array<Object, nil>
Reads several keys in a single isolated batch.
- #initialize ⇒ Object
-
#keys(direction) ⇒ NativeMapKeyScan
Opens a native ordered scan over the live keys only, yielding bare keys.
-
#remove(key) ⇒ void
Removes a key.
-
#rollback ⇒ nil
Discards the buffered uncommitted operations.
-
#scan(direction) ⇒ Object
Opens a native ordered scan over the live entries.
-
#set(key, value) ⇒ void
Inserts or overwrites a key.
Instance Method Details
#clear ⇒ void
This method returns an undefined value.
Removes every entry.
659 660 661 |
# File 'lib/prosody/native_stubs.rb', line 659 def clear raise NotImplementedError, "This method is implemented natively in Rust" end |
#commit ⇒ nil
Durably commits the buffered operations mid-handler.
686 687 688 |
# File 'lib/prosody/native_stubs.rb', line 686 def commit raise NotImplementedError, "This method is implemented natively in Rust" end |
#contains_key(key) ⇒ Boolean
Answers whether a stored cell exists for a key. No value decode and no resolver run (a message-backed map answers with zero Kafka fetches), but not no-I/O: a cache miss still reads the store.
625 626 627 |
# File 'lib/prosody/native_stubs.rb', line 625 def contains_key(key) raise NotImplementedError, "This method is implemented natively in Rust" end |
#get(key) ⇒ Object?
Reads the value for a key.
615 616 617 |
# File 'lib/prosody/native_stubs.rb', line 615 def get(key) raise NotImplementedError, "This method is implemented natively in Rust" end |
#get_many(keys) ⇒ Array<Object, nil>
Reads several keys in a single isolated batch.
633 634 635 |
# File 'lib/prosody/native_stubs.rb', line 633 def get_many(keys) raise NotImplementedError, "This method is implemented natively in Rust" end |
#initialize ⇒ Object
607 608 609 |
# File 'lib/prosody/native_stubs.rb', line 607 def initialize raise NotImplementedError, "This class is implemented natively in Rust" end |
#keys(direction) ⇒ NativeMapKeyScan
Opens a native ordered scan over the live keys only, yielding bare keys. Skips value decode and the resolver (a message-backed map enumerates keys with zero Kafka fetches), though not no-I/O.
679 680 681 |
# File 'lib/prosody/native_stubs.rb', line 679 def keys(direction) raise NotImplementedError, "This method is implemented natively in Rust" end |
#remove(key) ⇒ void
This method returns an undefined value.
Removes a key.
652 653 654 |
# File 'lib/prosody/native_stubs.rb', line 652 def remove(key) raise NotImplementedError, "This method is implemented natively in Rust" end |
#rollback ⇒ nil
Discards the buffered uncommitted operations.
693 694 695 |
# File 'lib/prosody/native_stubs.rb', line 693 def rollback raise NotImplementedError, "This method is implemented natively in Rust" end |
#scan(direction) ⇒ Object
Opens a native ordered scan over the live entries.
668 669 670 |
# File 'lib/prosody/native_stubs.rb', line 668 def scan(direction) raise NotImplementedError, "This method is implemented natively in Rust" end |
#set(key, value) ⇒ void
This method returns an undefined value.
Inserts or overwrites a key.
644 645 646 |
# File 'lib/prosody/native_stubs.rb', line 644 def set(key, value) raise NotImplementedError, "This method is implemented natively in Rust" end |