Crate hazelcast_rest [] [src]

This library is a wrapper around Hazelcast Rest API. API includes methods to interact with distributed queues and maps only. User can offer elements to named queues and poll elements from them. User can also put elements to a map, remove elements one by one or remove all elements at once from a map.

example


use hazelcast_rest::HazelcastRestClient;
let client = HazelcastRestClient::new("10.0.2.15", "5701");
client.queue_offer::<String>("sample_queue", "3".to_owned());
client.queue_offer::<String>("sample_queue", "4".to_owned());
assert_eq!(3, client.queue_delete("sample_queue", 10).unwrap().parse::<i32>().unwrap());

example


use hazelcast_rest::HazelcastRestClient;
let client = HazelcastRestClient::new("10.0.2.15", "5701");
client.map_put::<String>("capital_map", "Turkey", "Ankara".to_owned());
client.map_put::<String>("capital_map", "France", "Paris".to_owned());
client.map_put::<String>("capital_map", "Turkey", "Istanbul".to_owned());
client.map_remove_all("capital_map");
assert_eq!("Ankara", client.map_get("capital_map", "Turkey").unwrap());
assert_eq!("Paris", client.map_get("capital_map", "France").unwrap());

Structs

HazelcastRestClient

Hazelcast rest api client struct.