Examples of RepeatingCommand


Examples of com.ponysdk.ui.server.basic.PScheduler.RepeatingCommand

        // execute once
        updateUI(new RequestHandler() {

            @Override
            public void onRequest() {
                PScheduler.get().scheduleFixedDelay(new RepeatingCommand() {

                    @Override
                    public boolean execute() {
                        eventsListener.stackCommandResult(new PTestEvent(this, "Timer execution 1"));
                        return false;
                    }
                }, 50);
            }
        });

        final PTestEvent e1 = eventsListener.poll();
        Assert.assertEquals("Timer execution 1", e1.getBusinessMessage());

        // execute 3 times
        final AtomicInteger count = new AtomicInteger(0);
        updateUI(new RequestHandler() {

            @Override
            public void onRequest() {
                PScheduler.get().scheduleFixedDelay(new RepeatingCommand() {

                    @Override
                    public boolean execute() {
                        final int ct = count.incrementAndGet();
                        eventsListener.stackCommandResult(new PTestEvent(this, "Repeating timer execution " + ct));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.