Promise方式实现Node.js应用的实践
作者:
作者单位:

作者简介:

通讯作者:

中图分类号:

基金项目:


Web Application Based on Node.js in the Way of Promise
Author:
Affiliation:

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 增强出版
  • |
  • 文章评论
    摘要:

    Node.js是目前非常火热的技术之一,它是运行在服务器端的JavaScript执行环境. Node.js借助JavaScript的事件驱动机制加上V8高性能引擎,使得编写高性能Web服务轻而易举. Node.js在处理异步问题时一般采用的是callback回调的方式,但callback回调的方式存在Callback Hell的问题,无论是阅读还是调试都很不方便,甚至无法获取代码的堆栈. 基于Node.js平台,采用Promise方式,编写了一套网络爬虫的应用,在编写过程中详细的描述了如何使用Promise方式处理异步回调问题.

    Abstract:

    Node.js is one of the most popular technologies at present, and it is the JavaScript execution environment running on the server. With event-driven mechanism Node.js JavaScript plus high-performance V8 engine, it's easy to achieve high-performance Web services. When Node.js deals with the problem of asynchronous, it generally uses callback method, but there are Callback Hell problems in the way of callback. Whether reading or debugging is very inconvenient, it is even impossible to get the code stack. Based on Node.js platform, using Promise method, we realize a Web crawler application. We describe in detail how to use the Promise approach to deal with the problem of asynchronous callback during the application process.

    参考文献
    相似文献
    引证文献
引用本文

邓森泉,杨海波. Promise方式实现Node. js应用的实践.计算机系统应用,2017,26(4):218-223

复制
分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2016-07-26
  • 最后修改日期:2016-08-25
  • 录用日期:
  • 在线发布日期: 2017-04-11
  • 出版日期:
您是第位访问者
版权所有:中国科学院软件研究所 京ICP备05046678号-3
地址:北京海淀区中关村南四街4号 中科院软件园区 7号楼305房间,邮政编码:100190
电话:010-62661041 传真: Email:csa (a) iscas.ac.cn
技术支持:北京勤云科技发展有限公司

京公网安备 11040202500063号