Skip to content

Commit

Permalink
Fixing issues in async-log
Browse files Browse the repository at this point in the history
Autocommit Thu Jan 15 07:41:18 EST 2015
  • Loading branch information
mxro committed Jan 14, 2015
1 parent dd57050 commit 232b7df
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import de.mxro.async.AsyncCommon;
import de.mxro.async.Operation;
import de.mxro.async.callbacks.ValueCallback;
import de.mxro.async.properties.PropertyData;
import de.mxro.async.properties.PropertyNode;
import de.mxro.async.properties.PropertyOperation;
import de.mxro.concurrency.schedule.AccessThread;
Expand Down Expand Up @@ -31,7 +32,14 @@ public void apply(final ValueCallback<R> callback) {

@Override
public void process() {
decorated.record(op).apply(callback);
final R res;
try {
res = op.perform(decorated.getDataUnsafe());
} catch (final Throwable t) {
callback.onFailure(t);
return;
}
callback.onSuccess(res);
}
});
accessThread.startIfRequired();
Expand Down Expand Up @@ -146,4 +154,9 @@ public void process() {
this.accessThread.startIfRequired();
}

@Override
public PropertyData getDataUnsafe() {
return decorated.getDataUnsafe();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,10 @@ public void render(final ValueCallback<String> cb) {
cb.onSuccess(data.toString());
}

@Override
public PropertyData getDataUnsafe() {

return data;
}

}

0 comments on commit 232b7df

Please sign in to comment.