composable-core-location icon indicating copy to clipboard operation
composable-core-location copied to clipboard

Swift concurrency

Open rcasula opened this issue 3 years ago • 7 comments

Update the Library to the new swift-concurrency standard. I was thinking if removing the composable architecture dependency makes sense.

This PR is still in draft because I have to:

  • [ ] update documentation
  • [x] eventually remove the composable-architecture dependency

Please let me know if this PR is any good!

rcasula avatar Aug 14 '22 07:08 rcasula

@rcasula Thanks for looking into this! We definitely have plans to adopt this new style soon, but haven't had time to look into it. This looks good! Just a couple things we need to figure out in the future:

  1. Does the manager need to be protected in an actor? And what concurrency warnings show up when we turn on -Xfrontend -warn-concurrency -Xfrontend -enable-actor-data-race-checks?
  2. We'd probably want to coordinate this change with a library rename. Something like core-location-client or core-location-dependency.

Going to keep this open for now while we find the time to figure out those details. Thanks for getting this work started though!

stephencelis avatar Aug 15 '22 14:08 stephencelis

Hey, what is the status of this PR? What needs to be done to wrap up the new release?

3a4oT avatar Jun 20 '23 15:06 3a4oT

For completeness' sake, following a discussion in this PF's slack thread, to ensure CLLocationManager is accessed from the main RunLoop an alternative solution could be to use a MainActorIsolated structure as introduced here.

It appears to ensure CLLocationManager's APIs are invoked on the Main RunLoop, so it has the benefit of avoiding the Task { @MainActor } and not requiring sprinkling @MainActor in all API closures, making it less verbose and possibly less error prone as well if more APIs are added in the future.

Seems like an interesting approach, but ideally someone with more experience in swift concurrency can chime in, or at least we have one more approach to consider 🤓

p4checo avatar Sep 14 '23 10:09 p4checo

@rcasula can this MR be marked as ready for review? What documentation updates are missing? Thanks!

p4checo avatar Sep 21 '23 11:09 p4checo

friendly ping, can we please get an feedback?

3a4oT avatar Oct 05 '23 14:10 3a4oT

Hello, any chances to proceed with it?

3a4oT avatar Jul 30 '24 12:07 3a4oT