Skip to content

Commit 0a1c842

Browse files
Version Packages (#5779)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent af7916a commit 0a1c842

File tree

8 files changed

+71
-69
lines changed

8 files changed

+71
-69
lines changed

.changeset/shiny-views-admire.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/smart-pumas-dig.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/wise-books-lose.md

Lines changed: 0 additions & 56 deletions
This file was deleted.

packages/cluster/CHANGELOG.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,67 @@
11
# @effect/cluster
22

3+
## 0.53.2
4+
5+
### Patch Changes
6+
7+
- [#5778](https://github.com/Effect-TS/effect/pull/5778) [`af7916a`](https://github.com/Effect-TS/effect/commit/af7916a3f00acdfc8ce451eabd3f5fb02914d0bb) Thanks @tim-smart! - fix postgres unprocessed message ordering
8+
9+
- [#5778](https://github.com/Effect-TS/effect/pull/5778) [`af7916a`](https://github.com/Effect-TS/effect/commit/af7916a3f00acdfc8ce451eabd3f5fb02914d0bb) Thanks @tim-smart! - add @effect/cluster EntityResource module
10+
11+
A `EntityResource` is a resource that can be acquired inside a cluster
12+
entity, which will keep the entity alive even across restarts.
13+
14+
The resource will only be fully released when the idle time to live is
15+
reached, or when the `close` effect is called.
16+
17+
By default, the `idleTimeToLive` is infinite, meaning the resource will only
18+
be released when `close` is called.
19+
20+
```ts
21+
import { Entity, EntityResource } from "@effect/cluster"
22+
import { Rpc } from "@effect/rpc"
23+
import { Effect } from "effect"
24+
25+
const EntityA = Entity.make("EntityA", [Rpc.make("method")])
26+
27+
export const EntityALayer = EntityA.toLayer(
28+
Effect.gen(function* () {
29+
// When the entity receives a message, it will first acquire the resource
30+
//
31+
// If the entity restarts, the resource will be re-acquired in the new
32+
// instance.
33+
//
34+
// It will only be released when the idle TTL is reached, or when the
35+
// `close` effect is called.
36+
const resource = yield* EntityResource.make({
37+
acquire: Effect.acquireRelease(
38+
Effect.logInfo("Acquiring Entity resource"),
39+
() => Effect.logInfo("Releasing Entity resource")
40+
),
41+
// If the resource is not used for 10 minutes, it will be released and the
42+
// entity will be allowed to shut down.
43+
idleTimeToLive: "10 minutes"
44+
})
45+
46+
return EntityA.of({
47+
method: Effect.fnUntraced(function* () {
48+
yield* Effect.logInfo("EntityA.method called")
49+
// To access the resource, use `resource.get` inside an Effect.scoped
50+
yield* resource.get
51+
}, Effect.scoped)
52+
})
53+
}),
54+
{
55+
// After the resource is released, if the entity is not used for 1 minute,
56+
// the entity will be shut down.
57+
maxIdleTime: "1 minute"
58+
}
59+
)
60+
```
61+
62+
- Updated dependencies [[`af7916a`](https://github.com/Effect-TS/effect/commit/af7916a3f00acdfc8ce451eabd3f5fb02914d0bb)]:
63+
64+
365
## 0.53.1
466

567
### Patch Changes

packages/cluster/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@effect/cluster",
33
"type": "module",
4-
"version": "0.53.1",
4+
"version": "0.53.2",
55
"description": "Unified interfaces for common cluster-specific services",
66
"publishConfig": {
77
"access": "public",

packages/effect/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# effect
22

3+
## 3.19.6
4+
5+
### Patch Changes
6+
7+
- [#5778](https://github.com/Effect-TS/effect/pull/5778) [`af7916a`](https://github.com/Effect-TS/effect/commit/af7916a3f00acdfc8ce451eabd3f5fb02914d0bb) Thanks @tim-smart! - add RcRef.invalidate api
8+
39
## 3.19.5
410

511
### Patch Changes

packages/effect/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "effect",
3-
"version": "3.19.5",
3+
"version": "3.19.6",
44
"type": "module",
55
"license": "MIT",
66
"description": "The missing standard library for TypeScript, for writing production-grade software.",

packages/effect/src/internal/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
let moduleVersion = "3.19.5"
1+
let moduleVersion = "3.19.6"
22

33
export const getCurrentVersion = () => moduleVersion
44

0 commit comments

Comments
 (0)