Skip to content
This repository was archived by the owner on Oct 26, 2023. It is now read-only.

Commit bb61179

Browse files
committed
Updating readme and fix examples
1 parent 6ad3421 commit bb61179

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

README.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
node-finagle
22
=======================
33

4-
Proof of concept lib of a finagle-like composable `Service` in node.
4+
Proof of concept lib of a finagle-like composable `Service`/`Filter` in node.
55

66
A `Service` is basically a function `(input) => Promise<output>`
77

@@ -15,7 +15,6 @@ Things to support in mind:
1515
- Batch fork-join
1616
- Retry
1717
- Hedging requests ([more info](https://blog.acolyer.org/2015/01/15/the-tail-at-scale/))
18-
- Connection pooling
1918

2019

2120
Ideally it should be built on top of proved libraries like `dataloader`, `bluebird` and `generic-pool`
@@ -27,20 +26,18 @@ Idea:
2726
val filterStack = (
2827
FilterStack
2928
.prepare()
30-
.andThen(batching)
31-
.andThen(circuitBreaker({ requiredSuccessRate: 0.90, markDeadSeconds: 5 })),
32-
.andThen(forkJoin.list({ minBatchSize: 10 })),
33-
.andThen(hedgeRequest({ percentile: 95, minMs: 5 })),
34-
.andThen(connectionPooling(pool))
29+
.andThen(circuitBreaker(/* options */)),
30+
.andThen(caching(/* options */))
31+
.andThen(batching(/* options */))
32+
.andThen(dedup(/* options */))
33+
.andThen(forkJoin(/* options */)),
34+
.andThen(hedgeRequest(/* options */)),
3535
);
3636

37-
val loader = filterStack.build(({ client, args }) => {
38-
client.doSomething(args);
39-
});
37+
val loader = filterStack.build((req) => client.loadMany(req.ids));
4038

4139
const x = loader(1);
4240
const y = loader(2);
43-
4441
```
4542

4643

0 commit comments

Comments
 (0)