https://github.com/h2non/sharedworkers-angular-poc
A simple proof of concept using Shared WebWorkers + Two-way data binding in AngularJS
https://github.com/h2non/sharedworkers-angular-poc
Last synced: about 2 months ago
JSON representation
A simple proof of concept using Shared WebWorkers + Two-way data binding in AngularJS
- Host: GitHub
- URL: https://github.com/h2non/sharedworkers-angular-poc
- Owner: h2non
- Created: 2013-09-23T20:39:03.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-09-24T19:50:36.000Z (over 11 years ago)
- Last Synced: 2024-10-18T11:26:03.412Z (8 months ago)
- Language: CSS
- Homepage: http://h2non.github.io/sharedworkers-angular-poc
- Size: 9.09 MB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Shared WebWorkers + AngularJS PoC
Web Workers allow you to do things like fire up long-running scripts to handle computationally intensive tasks, but without blocking the UI or other scripts to handle user interactions. They're going to help put and end to that nasty 'unresponsive script' dialog that we've all come to love.
Workers utilize thread-like message passing to achieve parallelism. They're perfect for keeping your UI refresh, performant, and responsive for users.
Shared WebWorker allow you to share a Worker thread across different applications instances in the same browser, so you can communicate them without server communication like WebSockets or XHR.
## More information
- [W3C specification](http://www.w3.org/TR/workers)
- [HTML5Rocks tutorial](http://www.html5rocks.com/en/tutorials/workers/basics/)## About
This proof of concept aims to test some features of Web Shared WebWorkers and the amazing AngularJS two-way DOM data binding power, you can eaisly share data states and events across multiple window context instances using a basic implementation of an event bus service and a shared WebWorker.
Sharing and synchronizing data between different window instances (in the same browser sharing it's origin hostname) it's also possible via Web Storate API (aka localStorage), but if you don't need a layer of data persistence, it's more convenient to use Shared WebWorkers
## Test it
[Click here](http://h2non.github.io/sharedworkers-angular-poc/) for access to the live demo page
### Local
This process assumes you already have installed node.js in your system, and grunt-cli and bower as global packages and both are via $PATH accesible
1. Clone this repository
```
$ git clone https://github.com/h2non/sharedworkers-angular-poc.git
```2. From the cloned repository directory, run:
```
$ npm install
``````
$ bower install
```3. Start the server
```
$ grunt server
```4. Open diferent browser windows and start playing with the elements.
## Browser support
See browsers support clicking [here](http://caniuse.com/sharedworkers)
## Author
[Tomas Aparicio](https://github.com/h2non)
## License
MIT license