Skip to content

Instantly share code, notes, and snippets.

@sithu
sithu / ExecutorService Example
Last active December 27, 2015 05:39
Processing a task using a background thread via ExecutorService
package example.pubsub;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class BackgroundThread {
public static void main(String[] args) {
int numThreads = 1;
ExecutorService executor = Executors.newFixedThreadPool(numThreads);
# Artie - Artie Server
#
# Real-time messaging service
description "artie"
start on filesystem
stop on runlevel S
respawn