Skip to content
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

Test async-index-and-search with two service workers #8

Open
eklem opened this issue Nov 9, 2020 · 8 comments
Open

Test async-index-and-search with two service workers #8

eklem opened this issue Nov 9, 2020 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@eklem
Copy link
Owner

eklem commented Nov 9, 2020

One for indexing and one for searching?

  • Make two json-files to be indexed. One small to index first and then one big that can be indexed while the user searches within content in the first one.
  • A service worker for the indexing part and a service worker for the query part
  • Make two html files so you can click back and forth and still get info on how indexing is going, i.e. a message for every 1000 documents indexed.
@eklem eklem added the enhancement New feature or request label Nov 9, 2020
@eklem eklem self-assigned this Nov 9, 2020
@eklem
Copy link
Owner Author

eklem commented Nov 9, 2020

@fergiemcdowall Service workers looks interesting.

  • As web workers, they don't block the UI when doing processor heavy stuff, like indexing
  • For a site (or a part of a site / domain) they can run in the background even if you switch pages.
  • They can pull stuff from cache if up to date instead of using network. This means true offline applications

https://www.digitalocean.com/community/tutorials/demystifying-the-service-worker-lifecycle

I was thinking I should test that it can actually work, and then maybe make a library for service workers for search-index when v2.x.x is out.

@eklem
Copy link
Owner Author

eklem commented Nov 9, 2020

With this we can make a offline-first and the basis for non-blocking UI for search-index, and have it framework agnostic. So easier to make a browser application and still your choice of what to use to develop the application.

@eklem
Copy link
Owner Author

eklem commented Nov 9, 2020

@eklem
Copy link
Owner Author

eklem commented Nov 9, 2020

Seems only one service worker can be added to an app for what my purposes are:
https://stackoverflow.com/questions/42474908/using-multiple-javascript-service-workers-at-the-same-domain-but-different-folde

@eklem
Copy link
Owner Author

eklem commented Nov 10, 2020

Seems the idea is to add the possibility of running a worker / sharedWorker from a service worker, but not implemented yet.

w3c/ServiceWorker#678
whatwg/html#5601

@eklem
Copy link
Owner Author

eklem commented Nov 10, 2020

Hmm, seems it might actually be possible??? Will try
https://developer.mozilla.org/en-US/docs/Web/API/Client

@fergiemcdowall
Copy link
Collaborator

@eklem yes, very interesting!

@eklem
Copy link
Owner Author

eklem commented Nov 10, 2020

I'll explore =) If it works out, it could maybe take JSON input and give JSON output as a browser version of Norch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants