Giter Club home page Giter Club logo

nodejs-mystock's Introduction

介绍

本教程是在已经的stock教程基础上改写, 其主要目的是通过一个完整的项目来学习nodejs的编程**

cluster 说明

为了充分利用系统资源(因nodejs是单进程,通过插件cluster fork当前进程进而达到充分利用多核资源) 并且添加某个进程死掉重启的代码 注意, 在这里存在socket情况,代码中聊天代码是以单线程写的(后期如果需要,会继续改写),因此设计聊天页面的都不能正常访问(如果以cluster.js运行的话)

shellCommand命令说明

为了类似nginx 服务器一样,例如使用/etc/init.d/nginx start 和/etc/init.d/nginx stop 可以启动 和关闭Nginx服务器。我们通过bash脚本实现类似功能,创建shellCommand(文件名可以任意改写并放置/etc/init.d/文件中) 并通过_chmod +x shellCommand_赋予其执行权限

ps: 不同系统 改写参数DAEMON 和 PIDFILE 路径

启动方式:

$ ./shellCommand start

停止方式:

$ ./shellCommand stop

nodejs-mystock's People

Contributors

huangwen87 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.