Commit Graph

60 Commits

Author SHA1 Message Date
Kavon Farvardin
c5320c0206 express resignIdentity in SILGen as an unwind-only clean-up
turning it into a clean-up covers both failable and throwing initializers.

resolves rdar://84535066
2021-11-04 21:07:26 -07:00
Konrad `ktoso` Malawski
61a1bc2a6c [Distributed] remove public default AnyActorTransport alias
The previously set public AnyActorTransport was a temporary thing,
and instead we want to set this in every module that declares such
actors.
2021-11-04 15:54:56 +09:00
Doug Gregor
4aacc1c99e Make the actor identity type an associated type of ActorTransport
Eliminate the use of the type-erased `AnyActorIdentity` within the
distributed actor protocol by exposing the identity type of an actor
transport as an associated type, `Identity`, which is then used to
refer to all actors that have that transport.

Retain `AnyActorIdentity`, because it remains useful for type-erasing
actor transports, especially as the `Identity` type for
`AnyActorTransport`. For now, make it the default type of `Identity`:
this helps smooth over the transition from use of `AnyActorIdentity`,
but we might want to remove this to make use of the type-erased forms
always opt-in.
2021-11-03 08:58:21 -07:00
Doug Gregor
c2ba06c3d2 Make the actor transport an associated type of the DistributedActor protocol.
Eliminate the required use of existentials in distributed actors by
introducing the `Transport` associated type into the
`DistributedActor` protocol. Each distributed actor has a known
(concrete) actor transport type, reducing storage requirements and
transport dynamism when it isn't needed.

Distributed actors can manually specify their `Transport` associated
type or pick up a default by looking for a type named
`DefaultActorTransport`. A library that vends an actor transport can
make create a public typealias `DefaultActorTransport` referring to
its transport, so importing that library and defining a distributed
actor will use that library's transport.

Introduce a type-erased `AnyActorTransport` type to provide an
explicitly dynamic actor transport. This is still an important option,
e.g., for cases where one wants to be able to dynamically change the
transport for testing or different kinds of deployment. For now, we
default to this transport in the library (via `DefaultActorTransport`),
but we may very well want to eliminate this because it will be
ambiguous with client libraries that vend their own
`DefaultActorTransport`.
2021-11-01 22:37:33 -07:00
Doug Gregor
3da14e6f65 Refactor and generalize distributed actor transport SIL generation.
Refactor the code that generates SIL to call into the distributed actor
transport to eliminate duplication and better cope with concrete actor
transports. Centralize the knowledge of which actor transport is used
with a given distributed actor type.
2021-10-30 21:49:35 -07:00
Konrad `ktoso` Malawski
ab45cab941 [Distributed] Skip availability checks, checking if distributed is available is enough (#39899) 2021-10-26 10:38:34 +09:00
Arnold Schwaighofer
54319d774a Mark distributed_actor_default_init/deinit tests as requiring macOS
They currently block PR testing.
2021-10-23 10:50:22 -07:00
Kavon Farvardin
191c996d7e fix whitespace in check line for Linux 2021-10-22 10:10:25 -07:00
Kavon Farvardin
efe8f5ded6 add SIL coverage for current actorReady and resignIdentity calls 2021-10-21 19:41:31 -07:00
Kavon Farvardin
bdd8766909 Move the few SIL tests under the Distributed directory
Basically turn test/SIL/Distributed into test/Distributed/SIL

Since we have typechecking and runtime tests under there already,
and there are only a handful of distributed-actor specific SIL tests.
2021-10-21 19:41:31 -07:00