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

SharedFlow doesn't have same parameters as in constructor function #4194

Open
Mr3zee opened this issue Jul 26, 2024 · 2 comments
Open

SharedFlow doesn't have same parameters as in constructor function #4194

Mr3zee opened this issue Jul 26, 2024 · 2 comments

Comments

@Mr3zee
Copy link

Mr3zee commented Jul 26, 2024

MutableSharedFlow function has three parameters:

  • replay: Int
  • extraBufferCapacity: Int
  • onBufferOverflow: BufferOverflow

MutableSharedFlow interface, in turn, says in its documentation that an instance can be created using this function.
SharedFlow relays on these parameters. However, they are not a part of the interfaces and are present only as parameters to the constructor function. They are part of the SharedFlowImpl class, which is internal in kotlinx.coroutines.core.

This makes it hard to properly serialize SharedFlows in the kotlinx.rpc library.

Can you, please, advise what can be done to improve this situation? We need a multiplatform approach to retrieve these parameters, however, we don't have one now

@qwwdfsad
Copy link
Collaborator

Could you please elaborate on the lifecycle of such a SharedFlow? E.g. the particular use-case how and why it is serialized and what it represents to clients etc.

@dovchinnikov
Copy link
Contributor

@Mr3zee Why would you want to serialize shared flows in the first place?

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

3 participants