Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
hazelcast-python-client/examples/org-website/replicated_map_sample.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
16 lines (15 sloc)
635 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hazelcast | |
# Start the Hazelcast Client and connect to an already running Hazelcast Cluster on 127.0.0.1 | |
client = hazelcast.HazelcastClient() | |
# Get a Replicated Map called "my-replicated-map" | |
rmap = client.get_replicated_map("my-replicated-map").blocking() | |
# Put and Get a value from the Replicated Map | |
replaced_value = rmap.put("key", "value") | |
# key/value replicated to all members | |
print("replaced value =", replaced_value) | |
# Will be None as its first update | |
value = rmap.get("key") | |
# the value is retrieved from a random member in the cluster | |
print("value for key =", value) | |
# Shutdown this Hazelcast Client | |
client.shutdown() |