node-pinus / pinus

A fast,scalable,distributed game server framework for Node.js, Powered by TypeScript. 一个TypeScript写的node.js分布式游戏/应用服务器框架(原型基于pomelo)。
https://pinus.io
MIT License
1.8k stars 374 forks source link

关于Loader中的Ioc的讨论 #19

Open fuyifan opened 6 years ago

fuyifan commented 6 years ago

看到Loader中使用了IOC以及Reflect, 在之前的pomelo是没有的, 不知道作者在这块是如何考虑, 是否有示例@mybios

whtiehack commented 6 years ago

从使用上来说没有影响。一样用的。 与pomelo的结果是一样的。 如果说为什么这样写。那就等等@mybios 回答

mybios commented 6 years ago

这个原计划是把remote、handler等单件组件通过IOC模式创建的

Diluka commented 6 years ago

希望支持IOC,https://github.com/typestack/typedi 了解一下,我在web项目中用了大量的typestack的库,很好用

fuyifan commented 6 years ago

我觉得typestack 是包含很多有用的库,但是typedi 我觉得用处不大

George

在 2018年5月18日,上午9:39,Diluka notifications@github.com<mailto:notifications@github.com> 写道:

希望支持IOC,https://github.com/typestack/typedi 了解一下,我在web项目中用了大量的typestack的库,很好用

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/node-pinus/pinus/issues/19#issuecomment-390068082, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGa-OTvbMr9ZmCboojIM9MvO_RXzNag0ks5tziZfgaJpZM4TMKaB.

whtiehack commented 6 years ago

nestjs 了解一下。 https://github.com/nestjs/nest
我们的项目在用,和pinus结合的非常好。 handler remote 都可以管理到。

beiyu98 commented 4 years ago

nestjs 了解一下。 https://github.com/nestjs/nest 我们的项目在用,和pinus结合的非常好。 handler remote 都可以管理到。

现在nodejs中确实nestjs最好用了,这个也可以考虑把express替换成nestjs,ioc也确实更加方便

whtiehack commented 4 years ago

nestjs 了解一下。 https://github.com/nestjs/nest 我们的项目在用,和pinus结合的非常好。 handler remote 都可以管理到。

现在nodejs中确实nestjs最好用了,这个也可以考虑把express替换成nestjs,ioc也确实更加方便

这个还是不建议集成到 pinus里。 会增加很大的学习成本。有需要的可以自己研究。

如果需要的人多我可以放一个简单的demo到 examples里。当然,每个人的理解不一样,只能做为参考。

zhoujxMT commented 3 years ago

nestjs了解一下。https://github.com/nestjs/nest 我们的项目在用,和pinus结合的非常好。handler remote都可以管理到。

现在nodejs中确实nestjs最好用了,这个也可以考虑把express替换成nestjs,ioc也确实更加方便

这个还是不建议集成到pinus里。会增加很大的学习成本。有需要的可以自己研究。

如果需要的人多我可以放一个简单的demo到examples里。当然,每个人的理解不一样,只能做为参考。

求demo

starchen112 commented 3 years ago

nestjs 了解一下。 https://github.com/nestjs/nest 我们的项目在用,和pinus结合的非常好。 handler remote 都可以管理到。

现在nodejs中确实nestjs最好用了,这个也可以考虑把express替换成nestjs,ioc也确实更加方便

这个还是不建议集成到 pinus里。 会增加很大的学习成本。有需要的可以自己研究。

如果需要的人多我可以放一个简单的demo到 examples里。当然,每个人的理解不一样,只能做为参考。

求demo

punk2plus commented 2 years ago

nestjs 了解一下。 https://github.com/nestjs/nest 我们的项目在用,和pinus结合的非常好。 handler remote 都可以管理到。

现在nodejs中确实nestjs最好用了,这个也可以考虑把express替换成nestjs,ioc也确实更加方便

这个还是不建议集成到 pinus里。 会增加很大的学习成本。有需要的可以自己研究。

如果需要的人多我可以放一个简单的demo到 examples里。当然,每个人的理解不一样,只能做为参考。

能提供一个nest版本的demo吗?感谢🙏

whtiehack commented 2 years ago

这两天我抽时间搞一搞

whtiehack commented 2 years ago

https://github.com/node-pinus/pinus/commit/b2bb4fc368d18142a20990c58e1e1311b406e259

示例加上了

punk2plus commented 2 years ago

b2bb4fc

示例加上了

thanks

dubanflorin commented 6 months ago

Where you supposed to call useContainer(nestApp) in NestComponent?