Hi @MarkLewis I tried similar example with number as 50 for fib function using onComplete and the main thread completed before printing the result. If I understood from this video, my future should have waited to receive the value or an exception. Am I missing something? Most of the times, we would need a value from future to do something; hence is Await the only possible option and how should one determine the timeout window?
Yes, but it used to just be part of the language. Then they changed it so that it took a compiler flag or an import. In many ways, I like how it reads, but I think it causes issues for the parsing of the language. For that reason, I think they would like to deprecate it. I don't expect it to be an option on Dotty. I guess I could pull down Dotty and try, but I haven't had the motivation for that yet. I have to finish the book that this video is associated with in the next few days before I can play with other stuff.
Hi @MarkLewis I tried similar example with number as 50 for fib function using onComplete and the main thread completed before printing the result. If I understood from this video, my future should have waited to receive the value or an exception. Am I missing something? Most of the times, we would need a value from future to do something; hence is Await the only possible option and how should one determine the timeout window?
Wonderful tutorial thank you !
Glad it was helpful!
you could avoid the duration error by importing `import scala.language.postfixOps`
Yes, but I generally just put a dot as the postfix notation is now frowned upon.
matter of personal taste :)
Yes, but it used to just be part of the language. Then they changed it so that it took a compiler flag or an import. In many ways, I like how it reads, but I think it causes issues for the parsing of the language. For that reason, I think they would like to deprecate it. I don't expect it to be an option on Dotty. I guess I could pull down Dotty and try, but I haven't had the motivation for that yet. I have to finish the book that this video is associated with in the next few days before I can play with other stuff.