private void rescheduleTwinHandler()

in docker_images/java/wrapper/src/main/java/glue/ModuleGlue.java [221:249]


    private void rescheduleTwinHandler()
    {
        if (_twinHandler == null)
        {
            return;
        }
        // call _handler 2 seconds after the last designed property change
        if (this._timer != null)
        {
            this._timer.cancel();
            this._timer = null;
        }
        this._timer = new Timer();
        this._timer.schedule(new TimerTask()
        {
            @Override
            public void run()
            {
                _timer = null;
                if (_twinHandler != null && _twin != null)
                {
                    System.out.println("It's been 2 seconds since last desired property arrived.  Calling handler");
                    System.out.println(_twin.toString());
                    _twinHandler.handle(Future.succeededFuture(_twin));
                    _twinHandler = null;
                }
            }
        }, 2000);
    }