]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db/src/org/simantics/db/request/AsyncRead.java
Multiple reader thread support for db client
[simantics/platform.git] / bundles / org.simantics.db / src / org / simantics / db / request / AsyncRead.java
index a197a5f2169edeac7a501ee042d71b377be9f704..f0856a7967fc6b12553239dbe4b1db7ddfa30287 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007, 2010 Association for Decentralized Information Management
+ * Copyright (c) 2007, 2018 Association for Decentralized Information Management
  * in Industry THTH ry.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
@@ -50,7 +50,8 @@ import org.simantics.db.procedure.AsyncProcedure;
  * @see AsyncProcedure
  * @see Session
  */
-public interface AsyncRead<Result> extends Request {
+@FunctionalInterface
+public interface AsyncRead<Result> {
 
     /**
      * When a <code>GraphRequest</code> is serviced by the database session
@@ -76,6 +77,13 @@ public interface AsyncRead<Result> extends Request {
      *         be cancelled and any changes rolled back
      */
     void perform(AsyncReadGraph graph, AsyncProcedure<Result> procedure);
-    int getFlags();
-    
- }
+
+    default int getFlags() {
+        return 0;
+    }
+
+    default int threadHash() {
+        return hashCode();
+    }
+
+}