PageRenderTime 37ms CodeModel.GetById 25ms app.highlight 11ms RepoModel.GetById 0ms app.codeStats 0ms

/.metadata/.plugins/org.eclipse.core.resources/.history/29/20c447586ba3001e1d98c762f0e1eac2

https://bitbucket.org/fixpoint/connexion
#! | 36 lines | 28 code | 8 blank | 0 comment | 0 complexity | 88b24d708298104bec36d2ed4a908581 MD5 | raw file
 1package info.reflectionsofmind.connexion.util;
 2
 3import java.util.concurrent.Callable;
 4import java.util.concurrent.Executors;
 5import java.util.concurrent.Future;
 6import java.util.concurrent.SynchronousQueue;
 7
 8public class Waiter<T>
 9{
10	private T t;
11	private final SynchronousQueue<T> queue;
12
13	public Waiter()
14	{
15		this.queue = new SynchronousQueue<T>();
16
17		Callable<T> callable = new Callable<T>()
18				{
19			public T call()
20			{
21				Waiter.this.t = Waiter.this.queue.take();
22			}
23				};
24		Executors.newSingleThreadExecutor().submit(callable);
25	}
26
27	public void put(final T object)
28	{
29
30	}
31
32	public Future<T> get()
33	{
34
35	}
36}