Skip to content

Commit 257f675

Browse files
authored
Add documentation for Entry Processing (#9)
* Added documentation for Session * Updated documentation for Session * Added documentation for installation and basic operations * Fix validation error * Add documentation for querying and aggregation * Add documentation for Entry processing and fix validation errors
1 parent f14a29a commit 257f675

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

docs/entryprocessing.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,33 @@
55
66
Entry Processing
77
================
8+
9+
An entry processor allows mutation of map entries in-place within the cluster instead of bringing the entire object
10+
to the client, updating, and pushing the value back. See the `documentation <https://oracle.github.io/coherence/23.03/api/java/index.html>`_ for the processors provided by this client.
11+
12+
Assume the same set of keys and values are present from the filtering and aggregation examples:
13+
14+
.. code-block:: python
15+
16+
from coherence import NamedMap, Session, Filters, Aggregators, Processors
17+
import asyncio
18+
19+
# ...
20+
21+
# targeting a specific entry
22+
await map.invoke("0001", Processors.extract("age"))
23+
# returns: 38
24+
25+
# targeting all entries
26+
await map.invoke_all(Processors.extract("age"))
27+
# returns: [["0001", 38], ["0002", 56], ["0003", 48]]
28+
29+
# incrementing a number 'in-place'
30+
await map.invoke_all(Filters.greater("age", 40), Processors.increment("age", 1))
31+
# returns [["0002", 57], ["0003", 49]]
32+
33+
# update a value 'in-place'
34+
await map.invoke("0001", Processors.update("age", 100))
35+
# returns true meaning the value was updated
36+
await map.get("0001")
37+
# the value will reflect the new age value

0 commit comments

Comments
 (0)