Skip to content

Commit 9a98f5f

Browse files
Implement Redis pipeline request and pipe multiple requests
1 parent 0b6e76b commit 9a98f5f

File tree

9 files changed

+1124
-156
lines changed

9 files changed

+1124
-156
lines changed

.github/document.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export FL_TITLE="Functional Redis"
2+
export FL_DESCRIPTION="A simple Redis client in tune with Functional Programming principles in JavaScript for Deno."
3+
export FL_VERSION=$(git describe --tags --abbrev=0)
4+
5+
deno run --allow-all --unstable ../@functional:generate-documentation/cli.js document "$FL_TITLE" "$FL_DESCRIPTION" $FL_VERSION ./.github/readme-fragment-usage.md ./library/*.js ./.github/readme-fragment-license.md

.github/readme-fragment-license.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## License
2+
3+
Copyright © 2020 - Sebastien Filion
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

.github/readme-fragment-usage.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
## Usage
2+
3+
Functional Redis is optimized to write elegant and powerful point-free functions.
4+
This example uses the Ramda library - for simplification - but you should be able to use any library that implements the Fantasy-land specifications.
5+
6+
```js
7+
import { safeExtract } from "https://deno.land/x/[email protected]/library/utilities.js";
8+
import File from "https://deno.land/x/[email protected]/library/File.js";
9+
import { writeFile } from "https://deno.land/x/[email protected]/library/fs.js";
10+
import RedisRequest from "https://deno.land/x/[email protected]/library/RedisRequest.js";
11+
import {
12+
createRedisSession,
13+
pipeRedisCommand
14+
} from "https://deno.land/x/[email protected]/library/client.js";
15+
16+
const copyHogeToFuga = createRedisSession(
17+
compose(
18+
chain(
19+
compose(
20+
writeFile({}),
21+
concat(File.fromPath(`${Deno.cwd()}/hoge`))
22+
)
23+
),
24+
pipeRedisCommand(
25+
[
26+
RedisRequest.set({}, "hoge", "piyo"),
27+
RedisRequest.get("hoge"),
28+
RedisRequest.set({}, "fuga")
29+
]
30+
)
31+
)
32+
);
33+
34+
const container = await copyHogeToFuga({ port: 6379 }).run();
35+
36+
safeExtract("Failed to execute the request.", container);
37+
```
38+
39+

0 commit comments

Comments
 (0)