-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spec name #82
Comments
A background fetch isn't necessarily launched from a service worker, so the wrapping you imply doesn't really make sense.
If we're going to play semantics, then "transfer" doesn't make sense, as that suggests that the thing is no longer accessible at its source. If you're unconvinced, please transfer me £5000. Not only that, but we already have transferrables in the platform, transferring means you lose access to the thing in the source, and they're closely associated with workers.
A background fetch won't fail if (due to excellent network conditions) it is "short running". Avoiding "fetch" for something that is, by definition, a fetch, seems weird. Do you think
You've defined "transfer" to mean the same as "fetch", now you're proposing that we use it as an event name on the same object where we already have
But only because you've picked two words that mean the same thing in this context.
Only because you've omitted "background", and haven't replaced it with anything that communicates anything similar. |
Good point about transfer, and about it not necessarily being launched from the SW. Yes, I am not a big fan of the name I am not a big fan of the word background in general. Any async fetch basically runs in the background, depending on definition. This seems to be more because it is running out-of-line, and you don't necessarily have a reference to the object. I was trying to come up with a more descriptive word, but I see that |
I don't think we should deviate from "fetch" for the same reasons I gave in #80. As for "background", I get that it's an overloaded term, but I haven't heard or thought of anything better. Also, other systems use "background" in a similar way. |
The examples in the explainer are (all?) showing service worker integration. I think it makes sense to show examples of it being used outside of service worker. From first glance over the spec, I didn't notice it was exposed to Window as well, though that makes a lot of sense. |
So background fetches are potential long running tasks. Have you thought about whether we will get support for other similar long running tasks in the future? Potentially there is the use-case for geolocation (cc @anssik) and sensors (cc @dontcallmedom @anssik). Would it make sense to make -- |
Two of the four examples in the explainer show the background fetch being initiated from a page.
I don't see the benefit. |
Yes, the only way to get the |
Where would you fire the "complete" or "fail" event? |
I guess this depends on how we end up exposing Geolocation (geofencing), Sensors (step counter) etc. If we want things to run when the browser/service worker isn't, then using a worker is not enough, and we might end up with objects like |
@kenchris, could you open an issue at https://github.com/WICG/geolocation-sensor (for Geolocation specifics) and/or at https://github.com/w3c/sensors/ (if a generic feature) and link back to this issue. Thanks! This is to bring this discussion to the Devices and Sensors group's attention responsible for those specs. |
I think that's ok. Otherwise, if we go for |
This issue kinda sprawled. If any is it is still relevant, open specific issues. |
In response to w3ctag/design-reviews#279
I find it a bit confusing that it is called background fetch.
First of all, I am afraid that people who look to do long running uploads won't find the feature due to the name. But I also find the background term a bit confusing, especially because to most developers, the Service Worker already runs in the background, so now we have something running in the background of the background.
What I really believe this is, is a transfer manager for async transfers that can outlive service worker lives. It is more about long running than it is about background. I would probably go with something like Long running transfers.
With that in mind, we could also rename
backgroundfetch*
andbackgroundFetch
totransfer
, and we avoid the double fetch inawait registration.backgroundFetch.fetch(id, requests, options);
which would becomeawait registration.transfer.fetch(id, requests, options);
.transferManager
might be another suggestion.Event names would also be shorter, eg.
backgroundfetchcomplete
vstransfercomplete
The text was updated successfully, but these errors were encountered: