Skip to content

Commit

Permalink
Release 0.0.23
Browse files Browse the repository at this point in the history
  • Loading branch information
adamw committed Mar 12, 2024
1 parent b0bb1bc commit cd611af
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 30 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Safe direct-style concurrency and resiliency for Scala on the JVM. Requires JDK
[sbt](https://www.scala-sbt.org) dependency:

```scala
"com.softwaremill.ox" %% "core" % "0.0.22"
"com.softwaremill.ox" %% "core" % "0.0.23"
```

Documentation is available at [https://ox.softwaremill.com](https://ox.softwaremill.com).
Expand Down
30 changes: 30 additions & 0 deletions generated-doc/out/fork-local.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Fork locals

`ForkLocal`s replace usages of `ThreadLocal` when using ox's forks and structural concurrency. They are useful to
propagate auxiliary context, e.g. trace or correlation ids.

Implementation note: `ForkLocal`s are based on `ScopedValue`s, which are part of [JEP 429](https://openjdk.org/jeps/429).

A fork local needs to be first created with a default value. Then, its value can be set within a new [scope](fork-join.md).
Usually, a new supervised scope is created, within which the `ForkLocal` is set to the given value - but only within that
scope, as long as it's not completed. Hence, values are bound structurally:

```scala
import ox.{ForkLocal, fork, supervised}

val v = ForkLocal("a")
supervised {
println(v.get()) // "a"
fork {
v.supervisedWhere("x") {
println(v.get()) // "x"
fork {
println(v.get()) // "x"
}.join()
}
}.join()
println(v.get()) // "a"
}
```

Scoped values propagate across nested scopes.
4 changes: 2 additions & 2 deletions generated-doc/out/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ In addition to this documentation, ScalaDocs can be browsed at [https://javadoc.
## sbt dependency

```scala
"com.softwaremill.ox" %% "core" % "0.0.22"
"com.softwaremill.ox" %% "core" % "0.0.23"
```

## Scope of the project
Expand Down Expand Up @@ -67,7 +67,7 @@ We offer commercial support for ox and related technologies, as well as developm
error-handling
fork-join
error-handling-scopes
scoped-values
fork-local
retries
interruptions
resources
Expand Down
2 changes: 1 addition & 1 deletion generated-doc/out/kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Dependency:

```scala
"com.softwaremill.ox" %% "kafka" % "0.0.22"
"com.softwaremill.ox" %% "kafka" % "0.0.23"
```

`Source`s which read from a Kafka topic, mapping stages and drains which publish to Kafka topics are available through
Expand Down
26 changes: 0 additions & 26 deletions generated-doc/out/scoped-values.md

This file was deleted.

0 comments on commit cd611af

Please sign in to comment.