Basic Operations on Tuples
You can perform basic operations on tuples such as, Put, Get, Take, Lock, and Update.
- Put
- Stores a tuple into a space.
- Get
- Retrieves the complete entry associated with provided key field(s).
- Take
- Performs an atomic “get and remove” action on the entry for provided key field(s).
A take is a “consume” operation; therefore if two takes are initiated at the same time on the same entry, only one succeeds.
- Lock
- Performs an atomic “get and lock” action on the entry for provided key fields(). Can also lock a specific entry directly.
- Update
- Performs an atomic “compare and set” operation on the entry for provided key field(s). When used on a locked entry, also automatically unlocks it.
- UpdateField(s)
- Updates the values for the specified fields without having to pass all the fields to the space.
Get, Put, Take, Lock, and Update are single entry operations. Two additional combination atomic operations are provided:
For information on performing puts, gets, and takes, see
The Read and Write in a Space.
- Batch Versions of Tuple Operations
The ActiveSpaces API provides batch versions of the basic tuple operations, which operate on a collection of tuples instead of on than just one tuple. Using the batch forms of the operations increases throughput by parallelizing the operations (including operations over the network).
Related concepts
Related reference
Copyright © Cloud Software Group, Inc. All rights reserved.