Comments (3)
Maybe process.nextTick is good idea.
from dubbo-js.
不太容易去掉,和设计相关
希望在node和zookeeper连接的时候就确定订阅的接口信息
获取负载信息初始化socket pool不希望把这个过程推迟到请求处理的过程中
但是可以封装一些方法来简化这个问题,
registry: 'localhost:2181'
application:
name: node-dubbo-consumer
interfaces:
demoService:
interface: 'com.alibaba.dubbo.demo.DemoService'
version: '2.0.0'
group: ''
from: '../providers'
from dubbo-js.
总算找到了解决这个问题的方案,这个问题的难点不是怎么实现,而是typescript怎么去定义暴露服务类型,给出代码的完美提示。这个还真有点难。但是不去解决这个问题,真的代码写的很炸。
import A from 'A',
import B from 'B'
import c from 'C'
import ...
const dubbo = new Dubbo({
interfaces: [
'A',
'B',
'C',
......
]
});
const a = A(dubbo);
const b = B(dubbo);
const c = C(dubbo);
......
//整合egg
app.dubbo = {
a,
b,
c,
......
}
同学们想这个接口规模再提高10x 代码就无法看了,当然代码上有优化的空间,但是痛点就是类型的代码提示,一旦动态就无法精确获得类型提示。
我们的翻译器生成的代码格式基本都是
export xxProvider = (dubbo: Dubbo): XxProvider => dubbo.proxyService({...});
在typescript2.8以后支持了conditional type.可以很好解决我们这个问题。
就可以获取优秀的开发体验
enjoy :)
from dubbo-js.
Related Issues (20)
- dubbo-js的官方文章对外发布方案 HOT 1
- dubbo-js的logo图标确定 HOT 11
- Triple 协议资料
- dubbo-js技术文章汇总 HOT 1
- 2022-11-27 / dubbo-js-weekly-meetup (04) HOT 1
- Mvp 版本讨论 HOT 9
- dubb-js 代码编写规范和风格指导文档
- dubbo-js命令行工具方案 HOT 5
- 停止维护了? HOT 3
- Dubbo GSoC 2023 - Dubbo3 Node.js HTTP/2 RPC Protocol Implementation
- Apache Dubbo 开源之夏 2023 正式启动,贡献社区赢取 12000 奖金!
- v3 版本能提供完整的example 的示例不 HOT 1
- 初版 Web RPC 和 Node RPC 文档
- Insufficient implementation in v4.0.1
- 有考虑跟 skywalking-nodejs 做结合吗?
- 支持脱离 IDL 的开发模式
- 名字改为 protoc-gen-apache-dubbo-es
- 下面的文档地址打开都是404? HOT 2
- 文档问题
- Does Zookeeper registration now support? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dubbo-js.