Skip to content

Instantly share code, notes, and snippets.

@langmi
langmi / gist:1226119
Created September 19, 2011 07:46
AsyncTaskExecutorFactory example
public class AsyncTaskExecutorFactory {
...
public static SimpleAsyncTaskExecutor createInstance() {
SimpleAsyncTaskExecutor instance = new SimpleAsyncTaskExecutor();
// set concurrencyLimit according to available processors
// real simple 1:1 relation
Runtime runtime = Runtime.getRuntime();
int nrCpu = runtime.availableProcessors();
instance.setConcurrencyLimit(nrCpu);
@langmi
langmi / set_http_proxy__var_windows.bat
Created August 17, 2011 08:24
simple set command for http_proxy variable in windows
SET HTTP_PROXY=http://%USER%:%PASSWORD%@%SERVER%:%PORT%