https://github.com/akka/akka/issues/20133

On Thursday, March 24, 2016 at 4:53:10 PM UTC+2, Johannes Berg wrote:
>
> Okay good, thanks, that makes it clear then.
>
> I wouldn't like to see those docs removed altogether though, I always get 
> back there when there's something I've forgot and it explains very well the 
> "java friendly interface in akka.dispatch.Futures" and summarizes quite 
> well what you can do with futures in java code. If this documentation is to 
> be found elsewhere in some Scala documentation (for Java developers) you 
> could just provide a link though.
>
> Thanks,
> Johannes
>
>
> On Thursday, March 24, 2016 at 4:28:47 PM UTC+2, rkuhn wrote:
>>
>> I'm no Klang but I can assure you that all callbacks MUST be dispatched 
>> on the provided ExecutionContext—otherwise someone will invariably find a 
>> way to trigger a StackOverflowError. These docs should probably be removed 
>> completely since we also moved to Scala futures.
>>
>> Regards,
>>
>> Roland 
>>
>> Sent from my iPhone
>>
>> On 24 Mar 2016, at 15:20, Akka Team <[email protected]> wrote:
>>
>> I have a feeling that that doc remark is obsolete (these sections were 
>> not touched in years), but let the expert/Klang speak.
>>
>> -Endre
>>
>> On Thu, Mar 24, 2016 at 3:18 PM, Johannes Berg <[email protected]> wrote:
>>
>>> Hi!
>>>
>>> I've read the documentation at 
>>> http://doc.akka.io/docs/akka/2.4.2/java/futures.html and where the map 
>>> function is explained it's stated that "If the Future is already 
>>> complete though, it will be run in our current thread.". I've just done 
>>> some tests suggesting this statement would be false, it seems like it's 
>>> always dispatched on the execution context even though it's already 
>>> completed.
>>>
>>> For example this prints two different thread ID:s:
>>>
>>> System.out.println(Thread.currentThread().getId());
>>> Futures.successful(new Object()).map(new Mapper<Object, Object>() {
>>>     public Object apply(Object obj) {
>>>         System.out.println(Thread.currentThread().getId());
>>>     }
>>> }, system.dispatcher());
>>>
>>> Indeed I would prefer that behaviour and would like to trust that fact 
>>> but then the statement in the docs needs to be changed.
>>>
>>> Can somebody confirm this, I'm happy to create a bug report in github if 
>>> you think this indeed is a bug in the documentation.
>>>
>>> I also found some old stuff about this:
>>>
>>> https://www.assembla.com/spaces/akka/tickets/1054-complete-futures-asynchronously-when-replying-through-a-channel/details#
>>> http://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/
>>>
>>> Best Regards,
>>> Johannes Berg
>>>
>>> -- 
>>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>>> >>>>>>>>>> Check the FAQ: 
>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>> >>>>>>>>>> Search the archives: 
>>> https://groups.google.com/group/akka-user
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Akka User List" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at https://groups.google.com/group/akka-user.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> -- 
>> Akka Team
>> Typesafe - Reactive apps on the JVM
>> Blog: letitcrash.com
>> Twitter: @akkateam
>>
>> -- 
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to