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 fallback solution for Services #2511

Merged
merged 15 commits into from
Mar 11, 2023
Merged

Add fallback solution for Services #2511

merged 15 commits into from
Mar 11, 2023

Conversation

Nambers
Copy link
Contributor

@Nambers Nambers commented Feb 16, 2023

move Services from Native to CommonMain in order to add a additional fallback solution to find Services, and enable an easy way to override implementations.

todo: when "mirai.service.loader" != "jdk" / "fallback"

@Him188 Him188 added this to the 2.15.0-RC milestone Feb 16, 2023
@Him188 Him188 self-requested a review February 19, 2023 09:21
@Him188 Him188 added t:feature 类型: 新特性 s:core 子系统: mirai-core labels Feb 19, 2023
@Nambers Nambers requested a review from Him188 February 19, 2023 16:12
@Nambers Nambers requested a review from Him188 February 21, 2023 01:08
@Karlatemp
Copy link
Member

Karlatemp commented Feb 21, 2023

浅浅提一下,,, 这个好像,, 没把 native 的 service 注册移动到 common 吧?

重新看了一下 PR 内容, 好像理解错 pr 意思了

@Nambers Nambers requested review from Karlatemp and Him188 and removed request for Him188 and Karlatemp February 22, 2023 04:43
Copy link
Member

@Karlatemp Karlatemp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

还有个疑问就是

jvm 的平台 Services 是空的吧

@Nambers
Copy link
Contributor Author

Nambers commented Feb 24, 2023

还有个疑问就是

jvm 的平台 Services 是空的吧

目前还没注册任何 service 进去,之前188是说用这一套替代jdk自己的serviceLoader,以及可以用一些方式覆盖实现

@Him188
Copy link
Member

Him188 commented Feb 24, 2023

e
我的意思是也要给JVM注册,作为fallback,同时解决一些其他问题

@Nambers Nambers changed the title add fallback solution for Services [WIP] add fallback solution for Services Feb 25, 2023
@Nambers Nambers changed the title [WIP] add fallback solution for Services Add fallback solution for Services Feb 26, 2023
@Him188 Him188 linked an issue Mar 1, 2023 that may be closed by this pull request
@Nambers Nambers requested a review from Him188 March 3, 2023 22:33
@Karlatemp Karlatemp requested a review from Him188 March 11, 2023 09:57
@Karlatemp Karlatemp merged commit 3ff2737 into mamoe:dev Mar 11, 2023
@Him188 Him188 removed their request for review March 11, 2023 12:17
@Nambers Nambers deleted the service branch March 11, 2023 16:52
@Him188 Him188 modified the milestones: 2.15.0-RC, 2.15.0-M1 Mar 11, 2023
StageGuard pushed a commit to StageGuard/mirai that referenced this pull request Apr 14, 2023
* add fallback solution for Services

* use castUp

* throw exception when prop doesn't match

* cannot use castUp

* improve codes

* improve name of functions

* add both

* add override

* solve conflicts

* [core] Move MiraiCoreServices to common

* [core] Improvement

* update var names

* update func names

---------

Co-authored-by: Karlatemp <kar@kasukusakura.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s:core 子系统: mirai-core t:feature 类型: 新特性
Projects
None yet
Development

Successfully merging this pull request may close these issues.

因 SPI 不可用, 发送消息失败
3 participants