[vlc-devel] [RFC 0/2] New executor API
Thomas Guillem
thomas at gllm.fr
Thu Aug 27 10:25:21 CEST 2020
On Wed, Aug 26, 2020, at 21:55, Romain Vimont wrote:
> Thank you for your review.
>
> On Wed, Aug 26, 2020 at 09:42:21PM +0300, Rémi Denis-Courmont wrote:
> > Le keskiviikkona 26. elokuuta 2020, 20.19.55 EEST Romain Vimont a écrit :
> > > The background worker API works, but it turns out to be complex to use
> > > (IMO).
> > (...)
> > > I would like to propose a new API, hopefully easier to use.
> >
> > I agree...
> >
> > But.
> >
> > Adding yet another API is not exactly making things better, unless the goal is
> > to replace/remove the existing one.
>
> Yes, background_worker is used by:
> - the preparser
> - the fetcher
> - the thumbnailer
>
> I adapted the preparser to demonstrate usage, but if it is ok I plan to
> adapt the others and remove the background worker.
>
Maybe the new vlc_executor should also replace the vlc_timer API ?
> > (...)
> > > In order to support the background worker features, a timeout can be
> > > provided to automatically cancel/interrupt the task (which adds quite a lot
> > > of complexity).
> >
> > TBH, I don't really see the point. One Does Not Simply interrupt a runnable,
> > unless it is running in a dedicated process (which can be killed).
>
> For example, the preparser must be "interrupted" if preparsing takes
> more than x seconds. It currently works that way with the background
> worker.
>
> > Thus, the
> > runnable need to handle this internally, and there's not much point exposing
> > it to the runner.
>
> The action to interrupt must be provided by the user, because it depends
> on the specific run() implementation. For the preparser for example, the
> "interrupt" callback is basically calling
> input_item_parser_id_Release().
>
> Regards
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list