Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions stdlib/public/Distributed/DistributedActor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import _Concurrency
///
/// FIXME(distributed): We'd need Actor to also conform to this, but don't want to add that conformance in _Concurrency yet.
@_marker
@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
public protocol AnyActor: Sendable, AnyObject {
}

Expand All @@ -34,7 +34,7 @@ public protocol AnyActor: Sendable, AnyObject {
///
/// The 'DistributedActor' protocol provides the core functionality of any
/// distributed actor.
@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
public protocol DistributedActor:
AnyActor,
Identifiable,
Expand Down Expand Up @@ -84,7 +84,7 @@ public protocol DistributedActor:

// ==== Hashable conformance ---------------------------------------------------

@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
extension DistributedActor {
nonisolated public func hash(into hasher: inout Hasher) {
self.id.hash(into: &hasher)
Expand All @@ -98,11 +98,11 @@ extension DistributedActor {
// ==== Codable conformance ----------------------------------------------------

extension CodingUserInfoKey {
@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
public static let actorSystemKey = CodingUserInfoKey(rawValue: "$distributed_actor_system")!
}

@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
extension DistributedActor {
nonisolated public init(from decoder: Decoder) throws {
guard let system = decoder.userInfo[.actorSystemKey] as? ActorSystem else {
Expand All @@ -123,7 +123,7 @@ extension DistributedActor {

// ==== Local actor special handling -------------------------------------------

@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
extension DistributedActor {

/// Executes the passed 'body' only when the distributed actor is local instance.
Expand Down
16 changes: 8 additions & 8 deletions stdlib/public/Distributed/DistributedActorSystem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import Swift
import _Concurrency

@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
public protocol DistributedActorSystem: Sendable {
/// The identity used by actors that communicate via this transport
associatedtype ActorID: Sendable & Hashable & Codable // TODO: make Codable conditional here
Expand Down Expand Up @@ -135,7 +135,7 @@ public protocol DistributedActorSystem: Sendable {

// ==== ----------------------------------------------------------------------------------------------------------------
// MARK: Execute Distributed Methods
@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
extension DistributedActorSystem {

/// Prepare and execute a call to the distributed function identified by the passed arguments,
Expand Down Expand Up @@ -307,7 +307,7 @@ extension DistributedActorSystem {
}
}

@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
@_silgen_name("swift_distributed_execute_target")
func _executeDistributedTarget(
on actor: AnyObject, // DistributedActor
Expand All @@ -323,7 +323,7 @@ func _executeDistributedTarget(
// ==== ----------------------------------------------------------------------------------------------------------------
// MARK: Support types
/// A distributed 'target' can be a `distributed func` or `distributed` computed property.
@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
public struct RemoteCallTarget {
let _mangledName: String // TODO: StaticString would be better here; no arc, codesize of cleanups

Expand Down Expand Up @@ -425,7 +425,7 @@ public protocol DistributedTargetInvocationDecoder : AnyObject {
func decodeReturnType() throws -> Any.Type?
}

@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
public protocol DistributedTargetInvocationResultHandler {
associatedtype SerializationRequirement

Expand All @@ -439,10 +439,10 @@ public protocol DistributedTargetInvocationResultHandler {
/******************************************************************************/

/// Error protocol to which errors thrown by any `DistributedActorSystem` should conform.
@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
public protocol DistributedActorSystemError: Error {}

@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
public struct ExecuteDistributedTargetError: DistributedActorSystemError {
let message: String

Expand All @@ -451,7 +451,7 @@ public struct ExecuteDistributedTargetError: DistributedActorSystemError {
}
}

@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
public struct DistributedActorCodingError: DistributedActorSystemError {
public let message: String

Expand Down
16 changes: 8 additions & 8 deletions stdlib/public/Distributed/DistributedMetadata.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Swift
/// Get the parameter count from a mangled method name.
///
/// - Returns: May return a negative number to signal a decoding error.
@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
public // SPI _Distributed
func _getParameterCount(mangledMethodName name: String) -> Int32 {
let nameUTF8 = Array(name.utf8)
Expand All @@ -25,7 +25,7 @@ func _getParameterCount(mangledMethodName name: String) -> Int32 {
}
}

@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
@_silgen_name("swift_func_getParameterCount")
public // SPI _Distributed
func __getParameterCount(
Expand All @@ -38,7 +38,7 @@ func __getParameterCount(
///
/// - Returns: the actual number of types written,
/// or negative value to signify an error
@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
public // SPI _Distributed
func _getParameterTypeInfo(
mangledMethodName name: String,
Expand All @@ -56,7 +56,7 @@ func _getParameterTypeInfo(

/// - Returns: the actual number of types written,
/// or a negative value to signal decoding error.
@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
@_silgen_name("swift_func_getParameterTypeInfo")
public // SPI _Distributed
func __getParameterTypeInfo(
Expand All @@ -66,7 +66,7 @@ func __getParameterTypeInfo(
_ types: Builtin.RawPointer, _ typesLength: Int
) -> Int32

@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
public // SPI _Distributed
func _getReturnTypeInfo(
mangledMethodName name: String,
Expand All @@ -80,7 +80,7 @@ func _getReturnTypeInfo(
}
}

@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
@_silgen_name("swift_func_getReturnTypeInfo")
public // SPI _Distributed
func __getReturnTypeInfo(
Expand All @@ -93,15 +93,15 @@ func __getReturnTypeInfo(

/// Retrieve a generic environment descriptor associated with
/// the given distributed target
@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
@_silgen_name("swift_distributed_getGenericEnvironment")
public // SPI _Distributed
func _getGenericEnvironmentOfDistributedTarget(
_ targetNameStart: UnsafePointer<UInt8>,
_ targetNameLength: UInt
) -> UnsafeRawPointer?

@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
@_silgen_name("swift_distributed_getWitnessTables")
public // SPI _Distributed
func _getWitnessTablesFor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct LargeStruct : Codable {
var d: Double
}

@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
public distributed actor MyActor {
distributed func simple1(_: Int) {
}
Expand Down Expand Up @@ -78,7 +78,7 @@ public distributed actor MyActor {
}
}

@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
public distributed actor MyOtherActor {
distributed func empty() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct LargeStruct : Codable {
var d: Double
}

@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
public distributed actor MyActor {
distributed func simple1(_: Int) {
}
Expand Down Expand Up @@ -76,7 +76,7 @@ public distributed actor MyActor {
}
}

@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
public distributed actor MyOtherActor {
distributed func empty() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct LargeStruct : Codable {
var d: Double
}

@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
public distributed actor MyActor {
distributed func simple1(_: Int) {
}
Expand Down Expand Up @@ -76,7 +76,7 @@ public distributed actor MyActor {
}
}

@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
public distributed actor MyOtherActor {
distributed func empty() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct LargeStruct : Codable {
var d: Double
}

@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
public distributed actor MyActor {
distributed func simple1(_: Int) {
}
Expand Down Expand Up @@ -82,7 +82,7 @@ public distributed actor MyActor {
}
}

@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
public distributed actor MyOtherActor {
distributed func empty() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct LargeStruct : Codable {
var d: Double
}

@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
public distributed actor MyActor {
distributed func simple1(_: Int) {
}
Expand Down Expand Up @@ -82,7 +82,7 @@ public distributed actor MyActor {
}
}

@available(SwiftStdlib 5.6, *)
@available(SwiftStdlib 5.7, *)
public distributed actor MyOtherActor {
distributed func empty() {
}
Expand Down