Skip to content

Commit 6944ff0

Browse files
authored
Merge pull request #1 from myty/feature/denoize
2 parents 7d488cf + 8c4c5eb commit 6944ff0

File tree

19 files changed

+324
-1595
lines changed

19 files changed

+324
-1595
lines changed

.github/workflows/lint.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Lint
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
11+
jobs:
12+
linting:
13+
name: Linting
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- uses: denoland/setup-deno@v1.1.0
19+
with:
20+
deno-version: v1.x # Run with latest stable Deno.
21+
22+
- name: Check format
23+
run: deno fmt --check
24+
25+
- name: Run Linter
26+
run: deno lint

.github/workflows/test.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
11+
jobs:
12+
linting:
13+
name: Testing
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- uses: denoland/setup-deno@v1.1.0
20+
with:
21+
deno-version: v1.x # Run with latest stable Deno.
22+
23+
- name: Run Tests
24+
run: deno test --coverage=cov/
25+
26+
- name: Generate coverage report
27+
run: deno coverage --lcov cov > cov.lcov
28+
29+
- name: Upload coverage to Coveralls.io
30+
uses: coverallsapp/github-action@master
31+
with:
32+
github-token: ${{ secrets.GITHUB_TOKEN }} # Generated by GitHub.
33+
path-to-lcov: cov.lcov

.vscode/settings.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"deno.enable": true,
3+
"deno.suggest.autoImports": true,
4+
"deno.suggest.completeFunctionCalls": true,
5+
"deno.suggest.imports.autoDiscover": true,
6+
"deno.suggest.imports.hosts": {
7+
"https://deno.land": true,
8+
"https://x.nest.land": true,
9+
"https://crux.land": true
10+
},
11+
"deno.suggest.names": true,
12+
"deno.suggest.paths": true
13+
}

README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1-
# dispatch-queue
1+
# DispatchQueue
22

3-
[Edit on StackBlitz ⚡️](https://stackblitz.com/edit/vitest-dev-vitest-1sctkb)
3+
A deno and npm dispatch queue with the ability to configure multiple queue
4+
processors.
5+
6+
## Installation
7+
8+
### Deno
9+
10+
```bash
11+
import DispatchQueue from "https://deno.land/x/dispatch_queue/mod.ts";
12+
```
13+
14+
## Example Usage
15+
16+
```typescript
17+
const dispatcher = new DispatchQueue<string>({
18+
processor: (stringValue, workerId) => {
19+
conosle.log(`Worker, '${workerId}', is processing: '${stringValue}'`);
20+
},
21+
});
22+
23+
dispatcher.process("test1");
24+
// OUTPUT: "Worker, 'worker-1', is processing: 'test1'"
25+
```

mod.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { DispatchQueue } from "./src/dispatch-queue.ts";

0 commit comments

Comments
 (0)