Retrieving or taking a single tuple from a space is done using the space’s get or
take methods. These methods take a tuple as an argument, which must contain fields of the same name and type as the fields marked as key in the space’s
space definition. If there is a tuple in the space containing a tuple whose key field values match exactly the values in the tuple passed as argument stored in the space, these methods return a copy of that tuple inside a Result object. (In the case of the
take method, it also atomically removes that tuple from the space.)
Storing a tuple in a space is done using the space’s put method, which takes the tuple to put as an argument and returns what ever was overwritten in the space (if anything was) by the put.
If there is already a tuple containing a tuple with the same key field values stored the space at the time the put is invoked, this old tuple is quietly replaced by the new one. If this behavior is not desired, and the users wants to avoid overwriting an existing tuple by mistake, a special form of the space's update method should be used.
At the time the put is invoked, if there is already a matching tuple in the space and that tuple is locked, the method may block. It may block for up to the amount of time specified in the space definition’s LockWait attribute. After this amount of time, if the stored tuple is still locked, the put will fail, and that failure scenario will be indicated by the Result object's Status field (or the return value of the method in C) having a value of
LOCKED.