Last active
January 23, 2017 09:10
-
-
Save andrewstevenson/5f015c6a91fd47068d29ec2fb5d4c397 to your computer and use it in GitHub Desktop.
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 com.hazelcast.core.*; | |
import com.hazelcast.config.*; | |
import java.util.Map; | |
import java.util.Queue; | |
public class GettingStarted { | |
public static void main(String[] args) { | |
Config cfg = new Config(); | |
HazelcastInstance instance = Hazelcast.newHazelcastInstance(cfg); | |
Queue<String> queueCustomers = instance.getQueue("customers"); | |
queueCustomers.offer("Tom"); | |
queueCustomers.offer("Mary"); | |
queueCustomers.offer("Jane"); | |
System.out.println("First customer: " + queueCustomers.poll()); | |
System.out.println("Second customer: "+ queueCustomers.peek()); | |
System.out.println("Queue size: " + queueCustomers.size()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment