summaryrefslogtreecommitdiff
path: root/src/main/java/io/trygvis/queue/AsyncService.java
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2013-04-30 07:12:56 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2013-04-30 07:12:56 +0200
commit0a0b01664cf620f983549999b24a7740594a57d4 (patch)
tree3a226f4e33ec986f3bae598a547690b3f99e2e8d /src/main/java/io/trygvis/queue/AsyncService.java
downloadjdbc-queue-master.tar.gz
jdbc-queue-master.tar.bz2
jdbc-queue-master.tar.xz
jdbc-queue-master.zip
o Initial import.HEADmaster
Diffstat (limited to 'src/main/java/io/trygvis/queue/AsyncService.java')
-rwxr-xr-xsrc/main/java/io/trygvis/queue/AsyncService.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/main/java/io/trygvis/queue/AsyncService.java b/src/main/java/io/trygvis/queue/AsyncService.java
new file mode 100755
index 0000000..c12f794
--- /dev/null
+++ b/src/main/java/io/trygvis/queue/AsyncService.java
@@ -0,0 +1,27 @@
+package io.trygvis.queue;
+
+import java.util.*;
+
+public interface AsyncService {
+
+ /**
+ * @param name
+ * @param interval how often the queue should be polled for missed tasks in seconds.
+ */
+ Queue registerQueue(String name, int interval, AsyncCallable callable);
+
+ void stopQueue(Queue queue);
+
+ Queue getQueue(String name);
+
+ TaskRef schedule(Queue queue, String... args);
+
+ /**
+ * Polls for a new state of the execution.
+ */
+ Task update(Task ref);
+
+ interface AsyncCallable {
+ void run(List<String> args) throws Exception;
+ }
+}