swift-distributed-actors icon indicating copy to clipboard operation
swift-distributed-actors copied to clipboard

Added hook to lifecycle events

Open akbashev opened this issue 1 year ago • 6 comments

Ability to listen to actors lifecycles in a plugin.

Motivation:

Plugins give an option to extend system with some logic. Problem is sometimes you need to hook into actor's creation/deletion, which currently is impossible. As an example—for actor recovery we need to restore state when it's created and ready for cluster system, which can be done by some potential EventSourcingJournal.

By adding simple hook protocol we can enable this.

Modifications:

  • PluginActorLifecycleHook protocol
  • additional actorLifecycleHooks in plugins settings
  • inside ClusterSystem's actorReady and resignID are called for each hookable plugin added to the system.

akbashev avatar Apr 16 '24 16:04 akbashev

Still not sure about PluginActorLifecycleHook name 😅

akbashev avatar Apr 16 '24 16:04 akbashev

@swift-server-bot test this please

ktoso avatar May 16 '24 08:05 ktoso

@swift-server-bot add to allowlist

ktoso avatar May 16 '24 08:05 ktoso

@swift-server-bot test this please

ktoso avatar Oct 11 '24 11:10 ktoso

@swift-server-bot test this please

akbashev avatar Oct 16 '24 18:10 akbashev

@ktoso thx for merging main, fixed issue with soundness, now should be fine

akbashev avatar Oct 31 '24 22:10 akbashev

Xcode builds consistently timeout:

failed downloading 'https://github.com/apple/swift-protobuf/releases/download/protoc-artifactbundle-v31.1/protoc-31.1.artifactbundle.zip' which is required by binary target 'protoc': downloadError("The request timed out.")

ktoso avatar Sep 16 '25 22:09 ktoso