Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Worker.Output Sendable #313

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

g-mark
Copy link

@g-mark g-mark commented Nov 14, 2024

Adds Sendable conformance as a constraint on Workflow.Output.

Checklist

  • Unit Tests
  • UI Tests
  • Snapshot Tests (iOS only)
  • I have made corresponding changes to the documentation

@CLAassistant
Copy link

CLAassistant commented Nov 14, 2024

CLA assistant check
All committers have signed the CLA.

@g-mark g-mark marked this pull request as ready for review November 14, 2024 19:12
@g-mark g-mark requested a review from a team as a code owner November 14, 2024 19:12
Copy link
Collaborator

@mjohnson12 mjohnson12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this break register? I would be surprised if all Workers Outputs were Sendable.

@g-mark
Copy link
Author

g-mark commented Nov 14, 2024

Will this break register? I would be surprised if all Workers Outputs were Sendable.

I ran a local test a couple of weeks ago with no issues.

  • I'll set up an integration branch.

@g-mark
Copy link
Author

g-mark commented Nov 14, 2024

Integration passed 👍

Copy link
Contributor

@jamieQ jamieQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before we proceed further with this effort, i think we should have a bit of discussion around the motivation and future direction of this type of change to better expose things to the concurrency system. two thoughts that come to mind:

  1. imposing a Sendable conformance on a type is a fairly substantial ask in general since it's asserting that type must be able to be passed across arbitrary isolation domains. is this the right approach?
  2. is this potentially a source-break for existing clients, so would necessitate a major semver bump? (granted register is probably the primary one)

@g-mark
Copy link
Author

g-mark commented Nov 18, 2024

before we proceed further with this effort, i think we should have a bit of discussion around the motivation and future direction of this type of change to better expose things to the concurrency system.

That makes sense. For background, this came up because of a warning currently in WorkflowConcurrency while calling await send(output).

  1. imposing a Sendable conformance on a type is a fairly substantial ask in general since it's asserting that type must be able to be passed across arbitrary isolation domains. is this the right approach?

This is probably the right approach, given what Sendable types are. Although I struggle to think of another approach, I would love to hear all other ideas.

  1. is this potentially a source-break for existing clients, so would necessitate a major semver bump? (granted register is probably the primary one)

Yes it does have the potential to break clients if their Output types do not conform to Sendable, so I agree a major bump would be appropriate (side note: Alamofire changed a bunch of things to Sendable in a minor bump, and it broke some of our code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants