Skip to content
项目

apple/swift-service-context

在 GitHub 查看

关于

Minimal type-safe context propagation container

系统与基础设施

这些数字如何统计

实测星标增长

24小时
0
7天
+1
15天
+1
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

Swift Service Context

This package is now a thin compatibility layer. The implementation of ServiceContext moved into swift-distributed-tracing, where the type is named InstrumentationContext. import ServiceContextModule keeps compiling and behaving exactly as it does today, with no code changes required.

New projects, and existing ones that can freely update their code, should depend on swift-distributed-tracing directly and use InstrumentationContext (or Tracing, if they also need spans) instead of adding this package.

ServiceContext is a minimal context propagation container: a value type, propagated through task-local storage, that carries arbitrary key-value pairs across concurrent Swift code.

Dependency

If you already depend on this package, you do not need to change anything.

For new code, depend on swift-distributed-tracing directly instead:

dependencies: [
  .package(url: "https://github.com/apple/swift-distributed-tracing.git", from: "1.0.0")
]
targets: [
    .target(
        name: "MyAwesomeApp",
        dependencies: [
            .product(name: "Tracing", package: "swift-distributed-tracing")
        ]
    )
]

Depend on the Instrumentation product instead of Tracing if you only need context propagation, with no tracing spans.

Existing dependents

dependencies: [
  .package(url: "https://github.com/apple/swift-service-context.git", from: "1.0.0")
]
targets: [
    .target(
        name: "MyAwesomeApp",
        dependencies: [
            .product(name: "ServiceContextModule", package: "swift-service-context")
        ]
    )
]

探索相关项目

加载中…