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

Add plugins API #578

Merged
merged 5 commits into from
Feb 10, 2021
Merged

Add plugins API #578

merged 5 commits into from
Feb 10, 2021

Conversation

arkivanov
Copy link
Contributor

Add plugins API for Reaktive sources wrapping.

Closes #574

@arkivanov
Copy link
Contributor Author

@CherryPerry @mk-jones @saket Here is a draft of plugins API. Could you please review? When this will be finalised for Observable I will expand it for other source types. Also added usage example to the MainActivity. Thanks!

@CherryPerry
Copy link
Collaborator

Sorry, I do not have any experience with RxJava plugins, so I can't review it from API client perspective.

@arkivanov
Copy link
Contributor Author

arkivanov commented Jan 17, 2021

@CherryPerry Maybe you could just add your general thoughts about the API. The idea is to provide an ability to wrap all created sources with custom middlewares.

@saket
Copy link
Contributor

saket commented Jan 17, 2021

LGTM. Wanna add some documentation to ObservablePlugins.onAssemble?

@arkivanov arkivanov force-pushed the add-plugins branch 2 times, most recently from 90b355c to f766f2b Compare January 19, 2021 17:38
saket
saket previously approved these changes Jan 19, 2021
mike-n-jordan
mike-n-jordan previously approved these changes Jan 19, 2021
@CherryPerry CherryPerry self-requested a review January 22, 2021 17:13
CherryPerry
CherryPerry previously approved these changes Jan 22, 2021
@arkivanov
Copy link
Contributor Author

Native tests are crashing, I will fix

@arkivanov
Copy link
Contributor Author

@CherryPerry I added two commits:

  1. Converted plugins API to "top level style", removed object ReaktivePlugins and replaced with top level properties and functions. This is to comply with the existing API, like reaktiveUncaughtErrorHandler, resetReaktiveUncaughtErrorHandler(), overrideSchedulers(...), etc.
  2. Fixed the native SIGSEGV crash. This was due to the "undefined" property initialisation order in Kotlin, when in properties are in different files. Looks like (not only?) SharedImmutable properties are initialised at startup, and our various top-level val xxxOfEmpty properties were calling onAssembleXxx, which in turn were calling the unitialised (yet) top-level property plugins.

@arkivanov arkivanov marked this pull request as ready for review February 8, 2021 21:03
@arkivanov arkivanov merged commit de70e8a into badoo:master Feb 10, 2021
@arkivanov arkivanov deleted the add-plugins branch February 10, 2021 18:03
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.

Introduce a way to intercept operator assembly calls
4 participants