Skip to content

Commit d390727

Browse files
author
fresa
committed
Attempt att correcting syntax in readme file
1 parent 4f5df20 commit d390727

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
> A wrapper for web workers in angular
44
55
###Why?
6+
67
Using web workers is somewhat awkward in raw Javascript. Doing it in angular applications even more so.
78
Each web worker runs in it's own context, and this context is isolated from the angular application.
89

@@ -11,24 +12,31 @@ angular-workers provides an angular service which upon request creates a web wor
1112
The returned web worker runs it's own angular context which allows it to resolve angular dependencies.
1213

1314
##Installation
15+
1416
install with bower using:
1517
<pre><code>
1618
bower install angular-workers
1719
</pre></code>
20+
1821
##How to use
1922

2023
1. Depend on the WorkerService.
2124
2. Specify the URL to the file containing the angular script by invoking:
25+
2226
<pre><code>
2327
// The URL must be absolute because of the URL blob specification
2428
WorkerService.setAngularUrl(url)
2529
<pre><code>
30+
2631
3. OPTIONALLY: Specify how the web worker is to find any dependencies by invoking:
32+
2733
<pre><code>
2834
// The URL must be absolute because of the URL blob specification
2935
WorkerService.addDependency(serviceName, moduleName, url)
3036
</pre></code>
37+
3138
4. Create create a promise of an angularWorker by invoking:
39+
3240
<pre><code>
3341
var workerPromise = WorkerService.createAngularWorker(['input', 'output' /*additional optional deps*/,
3442
&nbsp;&nbsp;function(input, output /*additional optional deps*/) {
@@ -40,6 +48,7 @@ WorkerService.addDependency(serviceName, moduleName, url)
4048
&nbsp;&nbsp;&nbsp;&nbsp;// We may optionally depend on other angular services. These services can be used just as in the main thread.
4149
&nbsp;&nbsp;}]);
4250
</code></pre>
51+
4352
5. When the workerPromise resolves the worker is initialized with it's own angular context and is ready to use. Like so:
4453
<pre><code>
4554
workerPromise.then(function success(angularWorker) {
@@ -60,11 +69,13 @@ WorkerService.addDependency(serviceName, moduleName, url)
6069
The same initialized worker can be used many times with different input.
6170

6271
##Requirements
72+
6373
The browser running the angular service needs to support the following:
6474
* [Web Workers](http://caniuse.com/#feat=webworkers) (angular-workers does not use shared workers)
6575
* [Blob URLs](http://caniuse.com/#feat=bloburls), specifically [creating blobs from strings](https://developer.mozilla.org/en-US/docs/Web/API/URL.createObjectURL#Browser_compatibility)
6676

6777
##Limitations
78+
6879
The angular-workers is a wrapper around standard web workers. So all limitations with web workers apply.
6980
* Data sent between the worker and main thread is deep cloned. (angular-workers does not use transferable objects, yet)
7081
This means transferring large object (about >20Mb, [Communicating Large Objects with Web Workers in javascript, Samuel Mendenhall](http://developerblog.redhat.com/2014/05/20/communicating-large-objects-with-web-workers-in-javascript/))

0 commit comments

Comments
 (0)