Skip to content

Commit

Permalink
fixed docs only , bumbped version for npm
Browse files Browse the repository at this point in the history
  • Loading branch information
hisco committed Nov 23, 2018
1 parent e860f9c commit cad2807
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Speed was our greatest concern and not a full featured queue.

### Using TypeScript
```ts
import {ZeroQ} from 'zeroq';
import {DataQueue , TasksQueue} from 'zeroq';
//Now you can use both `ZeroQ.DataQueue` and `ZeroQ.TasksQueue`

```
Expand Down Expand Up @@ -155,26 +155,25 @@ While Node.js doesn't preform any task in parallel, the OS do.
Some of the following messages will be lost because the OS can't write two messages in parallel.
```js
const net = require('net');
const writeQueue = new TasksQueue(1);
const client = net.createConnection({ path: '/tmp/app.sock' }, () => {
for (let i=0;i<10000;i++){
writeQueue.push(()=>{
client.write(`check out ${i}` , writeQueue.release)
})
client.write(`check out ${i}`)
}
});

```
With tasks queue it's super safe and simple to make sure all your messages would arrive
```js
const net = require('net');
const writeQueue = new TasksQueue(1);
const client = net.createConnection({ path: '/tmp/app.sock' }, () => {
for (let i=0;i<10000;i++){
client.write(`check out ${i}`)
writeQueue.push(()=>{
client.write(`check out ${i}` , writeQueue.release)
})
}
});
```

```
### Asynchronous proccesing thousands of files
```js
const queue = new TasksQueue(1000);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zeroq",
"version": "1.0.7",
"version": "1.0.9",
"description": "Fast and simple in-memory queue implementation with configurable max concurrecy",
"main": "src/zeroq.js",
"types": "src/zeroq.d.ts",
Expand Down

0 comments on commit cad2807

Please sign in to comment.