java - Using Future<V> -


in documentation, shows example code future<v>, in gae datastore orm's can see usages pattern, implication of using future on doing datastore put, get or delete methods? common motivation on doing this?

the reason future used because database operations done asynchronously, can carry on doing whatever , come check result of database operation.

the implications of asynchronous store read value stale, ie put has been sent future operation not complete, or worse, value has been deleted, orm has solved you.

you can use future.get block current thread , wait operation complete , check result.


Comments

Popular posts from this blog

How to access named pipes using JavaScript in Firefox add-on? -

multithreading - OPAL (Open Phone Abstraction Library) Transport not terminated when reattaching thread? -

node.js - req param returns an empty array -