際際滷

際際滷Share a Scribd company logo
(EN)Lightning!!! talk on
              Handling
  Producer  Consumer
      use cases in Java


                            - Prasanna
                  Twitter @prasonscala
e-mail prassee.sathian at gmail dot com
What is Producer Consumer use case ??
How we handle it .....
Threads
  Dedicate separate thread
  for producer & consumer
  Handle sync'n
  Result in a code tedious to extend
  A traditional approach

        Producer                         Consumer
      <<Runnable>>                     <<Runnable>>
Queue
  A data structure
  Make use of existing classes in JDK
  Let the producer and consumer class rely on the
   queue

                          (Broker)
                           Queue
        Producer                          Consumer
      <<Runnable>>                      <<Runnable>>
Code Example !!!!
Small Sales Pitch

 Created a project implementing queue on
https://github.com/prassee/concProdCons
Questions
Thank you

More Related Content

Producer consumerproblem

  • 1. (EN)Lightning!!! talk on Handling Producer Consumer use cases in Java - Prasanna Twitter @prasonscala e-mail prassee.sathian at gmail dot com
  • 2. What is Producer Consumer use case ??
  • 3. How we handle it ..... Threads Dedicate separate thread for producer & consumer Handle sync'n Result in a code tedious to extend A traditional approach Producer Consumer <<Runnable>> <<Runnable>>
  • 4. Queue A data structure Make use of existing classes in JDK Let the producer and consumer class rely on the queue (Broker) Queue Producer Consumer <<Runnable>> <<Runnable>>
  • 6. Small Sales Pitch Created a project implementing queue on https://github.com/prassee/concProdCons