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

Support swift concurrency #167

Open
ivlevAstef opened this issue Sep 13, 2024 · 3 comments
Open

Support swift concurrency #167

ivlevAstef opened this issue Sep 13, 2024 · 3 comments

Comments

@ivlevAstef
Copy link
Owner

I don't know how, but it's need...

@ivlevAstef
Copy link
Owner Author

ivlevAstef commented Dec 14, 2024

branch: swift_concurrency.

Implemented:

  • fix swift 6/swift concurrency warnings/errors in library
  • Supported MainActor (yes it is safe to change the thread to main one if necessary)
  • Support async/await ??... but it's very hard support and I'm not sure what to do. In fact, these are two copies of the library - with support async await and without support, because it is necessary to transfer information about this to all classes.
  • Support other situations?? Check actor supported.

About MainActor, your can write:

@MainActor
final class MyMainActorClass { ... } (or UI)

------------------
container.register { @MainActor in MyMainActorClass(dep1: $0, dep2: $1, ...) }

And yes this class always maked on Main thread in MainActor content.

In current moment, swift 6 have bug, and your can't write:

container.register(MyMainActorClass.init)

because swift 6 considers it a init function call :(

@ivlevAstef
Copy link
Owner Author

if you have any suggestions or ideas for swift concurrency support, you can write to this task.

@ivlevAstef
Copy link
Owner Author

ivlevAstef commented Dec 14, 2024

swinject issue:
Swinject/Swinject#538

in current moments swinject community no ideas how this implemented... :(

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

No branches or pull requests

1 participant