0

I want to make a method in Java 8 that allows me to execute a MongoDB query on a different thread.

For this I want to use (?)

ExecutorService pool = Executors.newCachedThreadPool();

Now I would normally use something like pool.execute (() ->

I want to use it like that:

Async().updateUser(x) Async().createUser(x) etc.

Can anyone show or hint me how to do something like that? I don't know what I need to look for.

Franz-kun
  • 59
  • 1
  • 2
  • 7

0 Answers0