O'Reilly logo

Delphi Cookbook - Second Edition by Daniele Teti

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Monitoring things using futures

Futures are a great tool in the tool chest of every programmer. But, wait! What's a future?

Well, while a task can be seen as a sort of asynchronous procedure, a future can be seen as an asynchronous function. However, while using task, the process is quite clear (it runs in the background and uses some sort of messaging to talk to the other thread) the future is a bit more complex. When should I get the return value of the future? Let's talk about futures with an example. You can use futures to run tasks on a separate thread and then forget about them, but often, you'll want to use the result of the task. The future function returns an IFuture<T> reference that you can use to request the result of type T. The reference ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required