登录 注册
内容创作与媒体工具自动化与工作流开发者工具 channelsconcurrencygoroutinesjvmloomreactive-streams
529
Stars
37
Forks
24
Watchers
14
Open Issues
Apache-2.0
许可证
Scala
语言
2023-01-18
创建时间
2026-11-12
最近更新

项目能做什么

Ox 是面向 Scala 3 和 JDK 21+ 的并发与流处理库。它基于 JVM 虚拟线程,让开发者无需复杂的异步语法,就能以直观的“直接风格”编写高并发代码。核心功能包括结构化并发(安全管理生命周期与异常)、带背压的流处理,以及熔断、重试、限流等容错韧性机制。
来源:基于仓库元数据 · 内容以仓库实际 README 为准

使用说明 查看原始 README 原仓库文档

中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
# Ox

[![Ideas, suggestions, problems, questions](https://img.shields.io/badge/Discourse-ask%20question-blue)](https://softwaremill.community/c/ox)
[![CI](https://github.com/softwaremill/ox/workflows/CI/badge.svg)](https://github.com/softwaremill/ox/actions?query=workflow%3A%22CI%22)
[![Maven Central](https://img.shields.io/maven-central/v/com.softwaremill.ox/core_3)](https://central.sonatype.com/artifact/com.softwaremill.ox/core_3)
[![ScalaDoc](https://javadoc.io/badge2/com.softwaremill.ox/core_3/ScalaDoc.svg)](https://javadoc.io/doc/com.softwaremill.ox/core_3)

Safe direct-style streaming, concurrency and resiliency for Scala on the JVM. Requires JDK 21+ & Scala 3. Ox covers
the following areas:

* streaming: push-based backpressured streaming designed for direct-style, with a rich set of stream transformations,
  flexible stream source & sink definitions and reactive streams integration
* error management: retries, timeouts, a safe approach to error propagation, safe resource management  
* concurrency: high-level concurrency operators, developer-friendly structured concurrency, safe low-level primitives, 
  communication between concurrently running computations
* scheduling & timers
* resiliency: circuit breakers, bulkheads, rate limiters, backpressure

Ox enables writing simple, expression-oriented code in functional style. The syntax overhead is kept to a minimum, 
preserving developer-friendly stack traces, and without compromising performance.

To use Ox, add the following dependency, using either [sbt](https://www.scala-sbt.org):

```scala
"com.softwaremill.ox" %% "core" % "1.1.0"
```

Or [scala-cli](https://scala-cli.virtuslab.org):

```scala
//> using dep "com.softwaremill.ox::core:1.1.0"
```

Documentation is available at [https://ox.softwaremill.com](https://ox.softwaremill.com), ScalaDocs can be browsed at [https://javadoc.io](https://www.javadoc.io/doc/com.softwaremill.ox).

## Tour of ox

Run two computations [in parallel](https://ox.softwaremill.com/latest/high-level-concurrency/par.html):

```scala mdoc:compile-only
def computation1: Int = { sleep(2.seconds); 1 }
def computation2: String = { sleep(1.second); "2" }
val result1: (Int, String) = par(computation1, computation2)
// (1, "2")
```

[Timeout](https://ox.softwaremill.com/latest/high-level-concurrency/timeout.html) a computation:

```scala mdoc:compile-only
def computation3: Int = { sleep(2.seconds); 1 }
val result2: Either[TimeoutException, Int] = timeout(1.second)(computation3).catching[TimeoutException]
// `timeout` only completes once the loosing branch is interrupted & done
```

[Race](https://ox.softwaremill.com/latest/high-level-concurrency/race.html) two computations:

```scala mdoc:compile-only
def computation4: Int = { sleep(2.seconds); 1 }
def computation5: Int = { sleep(1.second); 2 }
val result3: Int = raceSuccess(computation4, computation5)
// as before, the loosing branch is interrupted & awaited before returning a result
```

[Structured concurrency](https
阅读完整原文

项目深度分析 规则生成(AI 未配置)

综合评分 58.6 分。该项目在“个人可实施性”维度得 30 分,“付费可能性”维度得 60.0 分,差异化空间 100.0 分(评分依据见评分卡)。

将 ox 改造为垂直场景 SaaS

产品构想保留核心能力,针对某一类用户(如某行业团队)做托管版,收取月费。
目标用户有该需求的中小团队 / 独立站长
难度/周期较高 · 2~4 周(MVP)
收费模式订阅制(如 ¥29~99/月)
竞争风险需验证付费意愿;注意许可证合规
依据 数据支持的判断:许可证与关键词显示存在商用与付费场景

面向细分需求的二次开发产品

产品构想基于 ox 的核心能力,聚焦一个更窄的场景(如某平台、某行业)做差异化。
目标用户该细分场景用户
难度/周期中 · 2~6 周
收费模式买断制 / 订阅制 / 广告
竞争风险细分需求规模需验证
依据 AI 推测:基于项目主题标签的判断
以上为规则引擎基于仓库公开数据生成的参考结论,包含推测成分,不构成投资或创业承诺;配置 AI 后可获得更深入的分析。
报告会保存到 个人中心

竞品与相似项目 GitHub Search 真实检索

相似项目数据正在完善中,暂不展示(避免误导)

项目优势与风险

技术成熟度创建于 2023-01-18,近 30 天仍在推送,发布过 73 个 Release
社区活跃Star 529 / Fork 37 / Issue 14(数据支持,可自行核实)
许可证Apache-2.0
主要风险上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价

安装与使用

此项目未提供 Docker 镜像,安装步骤以原仓库 README 为准(涉及依赖安装与环境配置,对新手门槛较高)。