Class PushPullThreads


  • public class PushPullThreads
    extends Object
    Play with three event producing threads that need to send their message via a shared method to a receiving thread that is listening. The PUSH-PULL over the inproc protocol with a synchronized send method is used to implement this. Messages are sent without waiting to not block the sending threads. Therefore, the HWM is set considerably higher to not lose any messages. A map of thread id to socket is used to create one socket per sending thread.

    Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
    BSD-style license. See Sim0MQ License.

    $LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $, initial version 30 Apr 2020
    Author:
    Alexander Verbraeck
    • Constructor Detail

      • PushPullThreads

        public PushPullThreads()
        Constructor.
    • Method Detail

      • main

        public static void main​(String[] args)
        Parameters:
        args - empty
      • call

        public void call​(String message)
        Process message and push to central thread.
        Parameters:
        message - the message to send