-
Couldn't load subscription status.
- Fork 1.4k
Implement ZLayer#reloadable #8077
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ready for plugging in the real implementation and testing!
|
I think we have a problem here because we can't use macros in the same compilation unit they are defined in. But we want to use the macro in the implementation of |
|
Also the Scala 3 macro implementation uses experimental features and so cannot be used from code that is not marked as experimental. |
Make `ServiceReloader` work
|
Okay this is ready to go. The last commit shows |
|
ZIO Config may be a really weird place to put this. Maybe we should introduce If ZIO comes to use macros more and more, this will be a common problem. And then ZIO Config can depend on What do you think? |
|
An additional question, should we deprecate zio.Reloadable in favor of |
|
Added a final touch to |
|
@jdegoes I don't think we can do that because the macro needs to use ZIO data types, in particular |
|
@adamgfraser Right, I imagined |
I think it could be considered deprecated after these changes because it forces you to go through |
|
@jdegoes Yes we could do that. It is a bit odd because the functionality that it actually exposes would just be this |
I can go either way. But I think if we're going to have more things like this, then it may make sense to have a project that contains them all, because that could improve discovery versus pushing "macro core" functionality into different projects across the ZIO ecosystem. An example is RPC: it would be nice to have some functionality in ZIO that lets you easily do RPC with a ZIO service. It requires similar macros to here. It could be added as an extension method on ZLayer, e.g. |
|
@adamgfraser Take your pick on where to put that, I'm good either way. |
|
👍 |
|
Maybe I missed the context, but doesn't |
|
@guersam It does. Right now it just contains the macros for generating service accessors. So it goes back to the idea that it becomes a little bit of a hodge hodge of somewhat unrelated functionality that is connected by the "how" versus the "what" but maybe that is the best we can do. |
|
Anyway, will certainly make it easier to iterate on this if we are doing in one project. |
|
I think this is ready to go now. |
|
Does documentation exist about this new feature? |
|
@khajavi Can you add? |
/claim #8075