Opened 7 months ago

Last modified 4 months ago

#5180 new change

Make interface of WebRequest asynchronous

Reported by: sergz Assignee:
Priority: P2 Milestone:
Module: Libadblockplus Keywords:
Cc: fhd Blocked By: #5179
Blocking: Platform: Unknown / Cross platform
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29428624/
https://codereview.adblockplus.org/29428650/
https://codereview.adblockplus.org/29433591/
https://codereview.adblockplus.org/29497591/

Description (last modified by sergz)

Background

It would be useful to provide users of libadblockplus with possibility to use their own scheduler for asynchronous operations. It's useful because, e.g. on MS Windows only one worker thread is enough to support all our asynchronous operations. In order to do it we should make the methods of injected interface of WebRequest asynchronous. All asynchronous operations should be cancelled when the implementation is destroyed (in particular by JsEngine).

In addition it fixes #3595 by design.

What to change

  • Add interface of WebRequest with asynchronous methods.
  • For default implementation use asynchronous executor from #5179 and allow to inject current synchronous implementation to the default async implementation. The latter will allow users of libadblockplus to continue to use their current implementation.
  • make corresponding changes in JsEngine and tests. To simplify the transition, we may somehow support for a short time JsEngine::SetWebRequest accepting synchronous implementation if it makes sense.

Change History (11)

comment:1 Changed 7 months ago by sergz

  • Blocked By 5182 added

comment:2 Changed 7 months ago by sergz

  • Description modified (diff)

comment:3 Changed 7 months ago by sergz

  • Blocked By 5182 removed

comment:4 Changed 7 months ago by sergz

  • Review URL(s) modified (diff)

comment:6 Changed 7 months ago by sergz

  • Review URL(s) modified (diff)

comment:8 Changed 4 months ago by sergz

  • Owner set to sergz

In order to simplify #5450 it makes sense to remove legacy WebRequest interface.

comment:9 Changed 4 months ago by sergz

  • Review URL(s) modified (diff)

comment:11 Changed 4 months ago by sergz

  • Owner sergz deleted

Basically this issue can be considered as finished because currently a user can already provide with the proper implementation, however the default implementation is still using detached threads, that's blocked by #5179. Current implementation accepts a scheduler function which after #5179 should use the scheduler.

Note: See TracTickets for help on using tickets.