GithubHelp home page GithubHelp logo

Comments (5)

zhuizhuhaomeng avatar zhuizhuhaomeng commented on June 15, 2024

sync data in the priviledge process, drop the request before the sync is completed.

from lua-resty-websocket.

x-077 avatar x-077 commented on June 15, 2024

Hello @zhuizhuhaomeng ,

Im not sure to understand. openresty is quite new for me could you please be a bit more specific ?

Thanks

from lua-resty-websocket.

doujiang24 avatar doujiang24 commented on June 15, 2024

@matth-c3

Can I do the same thing directly on nginx level using LUA
Could you please clarify the "same thing"? Do you want to use openresty to build a WebSocket server?

from lua-resty-websocket.

x-077 avatar x-077 commented on June 15, 2024

Hello @doujiang24 ,

No, I would like to use the lua-resty-websocket client to establish a persistant connection to a remote server, before openresty/nginx is resdy to accept connections. I would do that in the init_* block but its not possible with lua-resty-{weboscket / redis }.

from lua-resty-websocket.

doujiang24 avatar doujiang24 commented on June 15, 2024

okay, you can create a zero delay timer in init_worker_by_lua, like

init_worker_by_lua_block {
  local ok, err = ngx.timer.at(0, websocket_client_func)
}

you can do anything in the websocket_client_func then.

but just be noticed that the timer runs asynchronous, it won't stop openresty to accept connections.

from lua-resty-websocket.

Related Issues (20)

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.