Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Conceptual difference between Operation and Future #1

Closed
emartynov opened this issue Jul 21, 2015 · 2 comments
Closed

Conceptual difference between Operation and Future #1

emartynov opened this issue Jul 21, 2015 · 2 comments

Comments

@emartynov
Copy link

I was pointed to library through internal chat.

Some things already catch my attention and one of them - Operation class in comparing to Future.

Did you consider to use it?

@MaximEfimovRMR
Copy link
Contributor

Thank you for your interest!

In fact, Futures are used deep inside the library. But there is a big difference between Future and Operation – the last one is a class similar to Callable interface. Callable can be aggregate by Future, so in that way Future relates to Operation class as "contains".
While Future describes an entity which is "running", Operation only declares some entity which "can be run". That difference distance Operation content from the way it will be executed, and thus user has to know nothing about blocking executions, thread joining and other multithread concepts, concentrating only on writing business logic.

@emartynov
Copy link
Author

Thank you a lot for clarifications!

So Operation class is closer to Callable but still have notion about was it executed or cancelled.
One more addition that Future class doesn't expose also anything about multithreading.

I will close the issue. Bad that there is no ticket types like a question :)
Thank you for conversation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants