diff options
Diffstat (limited to 'src/main/java/com/orbekk/protobuf/RequestHandler.java')
-rw-r--r-- | src/main/java/com/orbekk/protobuf/RequestHandler.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/main/java/com/orbekk/protobuf/RequestHandler.java b/src/main/java/com/orbekk/protobuf/RequestHandler.java new file mode 100644 index 0000000..0232a2c --- /dev/null +++ b/src/main/java/com/orbekk/protobuf/RequestHandler.java @@ -0,0 +1,32 @@ +import java.util.concurrent.BlockingQueue; + +/** + * TODO: Move services to this class. + */ + +public class RequestHandler extends Thread { + private volatile boolean isStopped = false; + private final BlockingQueue<Data.Request> input; + private final BlockingQueue<Data.Response> output; + + public RequestHandler(BlockingQueue<Data.Request> input, + BlockingQueue<Data.Response> output) { + this.input = input; + this.output = output; + } + + private void handleRequest() { + + } + + @Override public void run() { + while (!isStopped) { + handleRequest(); + } + } + + @Override public void interrupt() { + super.interrupt(); + isStopped = true; + } +} |