Necko: support sending OnDataAvailable() to other threads: Difference between revisions

Line 13: Line 13:
== API Discussion ==
== API Discussion ==


1) Decision to divert data to other thread should be made in OnStartRequest().
1) Decision to divert data to other thread should only be made within OnStartRequest().


There seemed to be general agreement that the decision to offload OnDataAvailable() to a different thread should be made within OnStartRequest().  By this point, we will have the final channel for the request (i.e. any redirects, auth requests, etc, will have been resolved).  We will also have the Content-type of the request, which we will need to determine whether the data should be handled by an off-thread consumer (like the HTML parser) in the first place.
There seemed to be general agreement that the decision to offload OnDataAvailable() to a different thread should only be possible within OnStartRequest().  By this point, we will have the final channel for the request (i.e. any redirects, auth requests, etc, will have been resolved).  We will also have the Content-type of the request, which we will need to determine whether the data should be handled by an off-thread consumer (like the HTML parser) in the first place.


2) How to notify other-thread listener when request is complete?
2) How to notify other-thread listener when request is complete?
Confirmed users
431

edits