V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
einverne
V2EX  ›  Python

现在有没有方案可以在函数计算中部署 Python RPC 调用?

  •  
  •   einverne · 2021-06-25 10:13:42 +08:00 · 1378 次点击
    这是一个创建于 1029 天前的主题,其中的信息可能已经有所发展或是发生改变。

    比如阿里云的函数计算,或者 lambda 函数中部署的服务可不可以实现相互之间的 RPC 调用?

    因为函数计算大部分只能支持 HTTP 触发,所以想到可不可以使用 JSON-RPC 实现,不知道还有没有更好的办法。

    2 条回复    2021-07-02 14:59:38 +08:00
    abersheeran
        1
    abersheeran  
       2021-06-25 10:18:58 +08:00
    可以啊。https://github.com/abersheeran/rpc.py 用 WSGI 模式,直接在阿里云函数计算里指定 app 作为入口就行,那玩意用的就是 WSGI 协议。

    配合 https://github.com/abersheeran/aligi 你甚至可以不修改代码套一个 API 网关在前面,同时使用 API 网关和 HTTP 触发器。
    song135711
        2
    song135711  
       2021-07-02 14:59:38 +08:00
    把函数计算的服务通过网关映射到公网地址, 通过公网节点互相调用
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1236 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 17:51 · PVG 01:51 · LAX 10:51 · JFK 13:51
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.