Skip to content
Snippets Groups Projects
Commit e6b874bb authored by Herwin van Welbergen's avatar Herwin van Welbergen
Browse files

uses offer instead of put to avoid blocking the input buffer handler

parent 64a93640
No related branches found
No related tags found
No related merge requests found
...@@ -34,14 +34,7 @@ public class FutureIU ...@@ -34,14 +34,7 @@ public class FutureIU
String id = iu.getPayload().get(idKey); String id = iu.getPayload().get(idKey);
if (idVal.equals(id)) if (idVal.equals(id))
{ {
try queue.offer(iu);
{
queue.put(iu);
}
catch (InterruptedException e)
{
Thread.interrupted();
}
} }
} }
}, ImmutableSet.of(category)); }, ImmutableSet.of(category));
......
...@@ -40,7 +40,7 @@ public class FutureIUs ...@@ -40,7 +40,7 @@ public class FutureIUs
{ {
String id = iu.getPayload().get(idKey); String id = iu.getPayload().get(idKey);
resultsMap.putIfAbsent(id, new ArrayBlockingQueue<AbstractIU>(1)); resultsMap.putIfAbsent(id, new ArrayBlockingQueue<AbstractIU>(1));
resultsMap.get(id).add(iu); resultsMap.get(id).offer(iu);
} }
}, ImmutableSet.of(category)); }, ImmutableSet.of(category));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment