Skip to content

Producer/Consumer, Events Consumed by various threads and then collated in order of occurrence. Event uses UUID. Events are INITIAL, CREATING, CREATED, CLOSING & CLOSED. Makes use of ENUM. Makes use of Blocking Queue & ConcurrentSkipList collections for thread safe operations. Follows JDK5 Concurrent API. New multi-threaded techniques are being …

Notifications You must be signed in to change notification settings

FreeFries/Producer-Consumer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

croydon_code - Producer Consumer Pattern

Producer/Consumer, Events Consumed by various threads and then collated in order of occurrence. Event uses UUID. Events are INITIAL, CREATING, CREATED, CLOSING & CLOSED. Makes use of ENUM. Makes use of Blocking Queue & ConcurrentSkipList collections for thread safe operations. Follows JDK5 Concurrent API. New multi-threaded techniques are being used.


In order to run this example use the following arguments to get started
Use the ProducerConsumerPattern class main method to start this example.
Argument 0 - if true then uses vanilla Consumer Threads to do it's job, if false uses Executors instead
Argument 1 - Say how many events you would like the Producer to generate, 1000 for example
Argument 2 - Relevant only for Executors, tells the ExecutorService how big the thread pool is going to be, 10 for example.
Argument 3 - Says how many Consumer(s) you would like to rollover the events produced to the next event state, 5 for example.
Argument 4 - Tell the main thread to wait for say 3 seconds before attempting to terminate all the Consumer Executors or Threads

About

Producer/Consumer, Events Consumed by various threads and then collated in order of occurrence. Event uses UUID. Events are INITIAL, CREATING, CREATED, CLOSING & CLOSED. Makes use of ENUM. Makes use of Blocking Queue & ConcurrentSkipList collections for thread safe operations. Follows JDK5 Concurrent API. New multi-threaded techniques are being …

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages