Skip to content

Commit

Permalink
Revert "make Baggage Sendable (#17)" (#23)
Browse files Browse the repository at this point in the history
This reverts commit 2344023.
  • Loading branch information
ktoso committed Jan 29, 2022
1 parent 72997ed commit c8457ce
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 67 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@ Package.resolved
/*.xcodeproj
xcuserdata/
.swiftpm
.vscode/
.history
12 changes: 3 additions & 9 deletions Sources/InstrumentationBaggage/Baggage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@
//
//===----------------------------------------------------------------------===//

#if swift(>=5.5) && canImport(_Concurrency)
public typealias _Baggage_Sendable = Swift.Sendable
#else
public typealias _Baggage_Sendable = Any
#endif

/// A `Baggage` is a heterogeneous storage type with value semantics for keyed values in a type-safe fashion.
///
/// Its values are uniquely identified via `BaggageKey`s (by type identity). These keys also dictate the type of
Expand Down Expand Up @@ -71,8 +65,8 @@ public typealias _Baggage_Sendable = Any
/// `Baggage` does not expose more functions on purpose to prevent abuse and treating it as too much of an
/// arbitrary value smuggling container, but only make it convenient for tracing and instrumentation systems which need
/// to access either specific or all items carried inside a baggage.
public struct Baggage: _Baggage_Sendable {
private var _storage = [AnyBaggageKey: _Baggage_Sendable]()
public struct Baggage {
private var _storage = [AnyBaggageKey: Any]()

/// Internal on purpose, please use `Baggage.TODO` or `Baggage.topLevel` to create an "empty" baggage,
/// which carries more meaning to other developers why an empty baggage was used.
Expand Down Expand Up @@ -157,7 +151,7 @@ extension Baggage {

/// Carried automatically by a "to do" baggage.
/// It can be used to track where a baggage originated and which "to do" baggage must be fixed into a real one to avoid this.
public struct TODOLocation: _Baggage_Sendable {
public struct TODOLocation {
/// Source file location where the to-do `Baggage` was created
public let file: String
/// Source line location where the to-do `Baggage` was created
Expand Down
6 changes: 3 additions & 3 deletions Sources/InstrumentationBaggage/BaggageKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
/// }
///
/// This pattern allows library authors fine-grained control over which values may be set, and which only get by end-users.
public protocol BaggageKey: _Baggage_Sendable {
public protocol BaggageKey {
/// The type of value uniquely identified by this key.
associatedtype Value: _Baggage_Sendable
associatedtype Value

/// The human-readable name of this key.
/// This name will be used instead of the type name when a value is printed.
Expand All @@ -62,7 +62,7 @@ extension BaggageKey {
}

/// A type-erased `BaggageKey` used when iterating through the `Baggage` using its `forEach` method.
public struct AnyBaggageKey: _Baggage_Sendable {
public struct AnyBaggageKey {
/// The key's type represented erased to an `Any.Type`.
public let keyType: Any.Type

Expand Down
18 changes: 0 additions & 18 deletions docker/docker-compose.2004.54.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions docker/docker-compose.2004.55.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions docker/docker-compose.2004.main.yaml

This file was deleted.

0 comments on commit c8457ce

Please sign in to comment.