@Override public void test(final Store<String, Object> store) { IntegerRange _upTo = new IntegerRange(1, 50); for (final Integer j : _upTo) { store.putSync(("" + j), ("e" + j)); } final Operation<List<Success>> _function = new Operation<List<Success>>() { @Override public void apply(final ValueCallback<List<Success>> cb) { final Aggregator<Success> col = Async.<Success>collect(50, cb); IntegerRange _upTo = new IntegerRange(1, 50); for (final Integer i : _upTo) { new Thread() { @Override public void run() { store.getSync(("" + i)); ValueCallback<Success> _createCallback = col.createCallback(); _createCallback.onSuccess(Success.INSTANCE); } }.start(); } } }; Async.<List<Success>>waitFor(_function); }
@Override public void putSync(final K key, final V value) { waitTillEmpty(); decorated.putSync(key, value); }