Coder Social home page Coder Social logo

sleepy_hollow's Introduction

Sleepy hollow


Long polling用

起動

ruby lp_server.rb  -p 5228

最大同時セッションは300です。

利用方法

Server側のレスポンスを10秒間停止させる。

http://higan.example.com?wait=10

Websocket用

起動

ruby ws_server.rb -p 5228

最大同時セッションは上限未計測ですが5000程度までは確認しています。

利用方法

Server側のレスポンスを10秒間停止させる場合、Websocket接続後に

送られたメッセージの数値分waitし、その後 "wait: <待ち時間>s" とレスポンスを返します。

10
-- sleep 10 seconds -- 
> wait: 10s

テストする場合はnode.jsのwscat等のWebSocketクライアントで接続する。

npm install -g ws
$ wscat -c ws://localhost:5228/
connected (press CTRL+C to quit)
> 5
-- sleep 5 seconds -- 
< wait: 5s

sleepy_hollow's People

Contributors

sawanoboly avatar sutetotanuki avatar

Watchers

 avatar  avatar James Cloos 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.