Examples of WorkerPool


Examples of com.google.gwt.gears.client.workerpool.WorkerPool

   * Test method for
   * {@link com.google.gwt.gears.client.Factory#createWorkerPool()}.
   */
  public void testCreateWorkerPool() {
    Factory factory = Factory.getInstance();
    WorkerPool workerPool = factory.createWorkerPool();
    assertNotNull("Factory.createWorkerPool() returned null", workerPool);
  }
View Full Code Here

Examples of com.google.gwt.gears.workerpool.client.WorkerPool

     * This is an empty bit of code that just shows what a WorkerPool
     * might look like. This isn't a great fit for this class, becasue
     * Worker's can't have any access to the DOM.
     */
    private void doWorkerPoolDemo() {
        WorkerPool wp = null;
        try {
            wp = new WorkerPool(new MessageHandler() {

                public void onMessageReceived(String message,
                        int srcWorker) {
                    Log.info("Message: " + message + " src:" + srcWorker);
                }
            });

            wp.createWorkerFromString("");

        } catch (GearsException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
View Full Code Here

Examples of net.greghaines.jesque.worker.WorkerPool

        TestUtils.resetRedis(config);
    }

    @Test
    public void testAdminAndWorkerPool() {
        final WorkerPool workerPool = new WorkerPool(new Callable<WorkerImpl>() {
            public WorkerImpl call() {
                return new WorkerImpl(config, set(testQueue),
                        new MapBasedJobFactory(map(entry("TestAction", TestAction.class))));
            }
        }, 2);
        final Admin admin = new AdminImpl(config);
        admin.setWorker(workerPool);

        workerPool.run();
        final Thread adminThread = new Thread(admin);
        adminThread.start();

        Assert.assertFalse(workerPool.isPaused());

        try {
            // TODO: Do client stuff here
        } finally {
            TestUtils.stopWorker(admin, adminThread);
            try {
                workerPool.endAndJoin(false, 1000);
            } catch (Exception e) {
                log.warn("Exception while waiting for workerThread to join", e);
            }
        }
    }
View Full Code Here

Examples of net.greghaines.jesque.worker.WorkerPool

    @Test
    public void testZREM() {
        // Start workers
        final WorkerImplFactory workerFactory = new WorkerImplFactory(CONFIG, Arrays.asList(QUEUE),
                new MapBasedJobFactory(map(entry(TestAction.class.getSimpleName(), TestAction.class))));
        final WorkerPool workerPool = new WorkerPool(workerFactory, 10);
        workerPool.run();

        // Start jobs
        enqueue();

        // Wait a few seconds then shutdown
        try { Thread.sleep(15000); } catch (Exception e){} // Give ourselves time to process
        CLIENT.end();
        try { workerPool.endAndJoin(true, 100); } catch (Exception e){ e.printStackTrace(); }
    }
View Full Code Here

Examples of org.apache.axis2.transport.base.threads.WorkerPool

                     TransportInDescription transportInDescription)
            throws AxisFault {
        log.info("Initializing the RelayTransport Listener..");

        Object obj = configurationContext.getProperty(RelayConstants.RELAY_TRANSPORT_WORKER_POOL);
        WorkerPool workerPool = null;
        if (obj != null) {
            workerPool = (WorkerPool) obj;
        }

        // is this a SSL listener?
View Full Code Here

Examples of org.apache.axis2.transport.base.threads.WorkerPool

        // is this an SSL Sender?
        sslContext = getSSLContext(transportOutDescription);
        SSLIOSessionHandler sslSetupHandler = getSSLSetupHandler(transportOutDescription);

        WorkerPool workerPool = null;
        Object obj = configurationContext.getProperty(
                RelayConstants.RELAY_TRANSPORT_WORKER_POOL);
        if (obj != null) {
            workerPool = (WorkerPool) obj;                                  
        }
View Full Code Here

Examples of org.apache.isis.runtimes.dflt.remoting.transport.sockets.shared.WorkerPool

    public void init() {
        super.init();

        final int port = getConfiguration().getInteger(SocketsViewerConstants.SERVER_PORT, SocketTransportConstants.PORT_DEFAULT);

        workerPool = new WorkerPool(5);

        final ServerFacadeImpl serverFacade = new ServerFacadeImpl(getAuthenticationManager());
        serverFacade.setEncoder(encoderDecoder);

        final ServerFacade sd = new ServerFacadeLogger(encoderDecoder, serverFacade);
View Full Code Here

Examples of org.apache.isis.runtimes.dflt.remoting.transport.sockets.shared.WorkerPool

        super.init();

        final int port =
            getConfiguration().getInteger(SocketsViewerConstants.SERVER_PORT, SocketTransportConstants.PORT_DEFAULT);

        workerPool = new WorkerPool(5);

        final ServerFacadeImpl serverFacade = new ServerFacadeImpl(getAuthenticationManager());
        serverFacade.setEncoder(encoderDecoder);

        final ServerFacade sd = new ServerFacadeLogger(encoderDecoder, serverFacade);
View Full Code Here

Examples of org.jboss.netty.channel.socket.nio.WorkerPool

    protected void setupTCPCommunication() throws Exception {
        if (channelFactory == null) {
            // prefer using explicit configured thread pools
            BossPool bp = configuration.getBossPool();
            WorkerPool wp = configuration.getWorkerPool();

            if (bp == null) {
                // create new pool which we should shutdown when stopping as its not shared
                bossPool = new NettyClientBossPoolBuilder()
                        .withTimer(getEndpoint().getTimer())
View Full Code Here

Examples of org.jboss.netty.channel.socket.nio.WorkerPool

    protected void setupTCPCommunication() throws Exception {
        if (channelFactory == null) {
            // prefer using explicit configured thread pools
            BossPool bp = configuration.getBossPool();
            WorkerPool wp = configuration.getWorkerPool();

            if (bp == null) {
                // create new pool which we should shutdown when stopping as its not shared
                bossPool = new NettyClientBossPoolBuilder()
                        .withBossCount(configuration.getBossCount())
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.