2 * Copyright (c) 2014 Cable Television Laboratories, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.pcmm.concurrent;
11 import org.pcmm.base.IAdapter;
16 public interface IWorkerPool extends IAdapter<IWorker> {
18 static int DEFAULT_MAX_WORKERS = 32;
21 * schedules a worker for beginning its task after t milliseconds.
27 * @return the id of the worker (PID) to be used for killing the worker if
30 int schedule(IWorker worker, int t);
33 * schedules a worker for immediate execution.
37 * @return the id of the worker (PID) to be used for killing the worker if
40 int schedule(IWorker worker);
43 * kills the worker with the specified pid
47 void sendKillSignal(int pid);
50 * sends a terminate signal for all active workers and recycles the pool.
55 * cleans up the pool from finished tasks