Opened 3 years ago

Closed 2 years ago

#5180 closed change (fixed)

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):

Description (last modified by sergz)


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 (12)

comment:1 Changed 3 years ago by sergz

  • Blocked By 5182 added

comment:2 Changed 3 years ago by sergz

  • Description modified (diff)

comment:3 Changed 3 years ago by sergz

  • Blocked By 5182 removed

comment:4 Changed 3 years ago by sergz

  • Review URL(s) modified (diff)

comment:6 Changed 3 years ago by sergz

  • Review URL(s) modified (diff)

comment:7 Changed 3 years ago by abpbot

comment:8 Changed 3 years ago by sergz

  • Owner set to sergz

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

comment:9 Changed 3 years ago by sergz

  • Review URL(s) modified (diff)

comment:11 Changed 3 years 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.

comment:12 Changed 2 years ago by sergz

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.