-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usage with OpenResty? #14
Comments
Hello, sorry, I don't know anything about OpenResty. Is it much like node? node-vips is asynchronous, so it should be possible: https://github.com/jcupitt/node-vips All you do is start a thread to do the computation (computation will always happen from |
I'm not sure if that's possible, but I'll see what I can do. In this thread, some people suggest using a background queue and/or possibly running it in another process via sockproc, but I was looking for a simpler solution. Anyway, I'll do a quick test and see how it goes. I just wanted to check if this was something you had on your radar or not. And thanks for the quick answer, by the way! |
Would this work? https://github.com/torch/threads It looks like you can fire off background threads and get a callback on the main thread when the background task completes. |
It might! I'll give it a shot and let you know if it works. |
Quick question: any idea why I might be seeing this?
The process seems to hang after that, and doesn't respond to any more requests. |
I'd guess it's being inited in parallel, or perhaps not shut down properly, then inited again. What are you doing to cause the error? |
Thinking a bit more, I'd guess you are running |
@tomas How did you use lua-vips with openresty? |
You see this error message because you connect the "vips" inside each worker_process what nginx start, Most likely you wright To fix this error you must add
When you add Use You can read more about this behavior in documentation: https://github.com/openresty/lua-nginx-module#init_by_lua |
Ah, very interesting. Thank you @maxim-avramenko ! |
U R welcome ;) i think it is good idea to update lua-vips wiki with instruction "how to deploy with Docker", it will save millions of hours to a lot of people |
I've not done much with openresty myself, I've been using lua vips with plain lua. @kleisauke, I think you are deploying lua-vips and openresty, do you have a sample config you could share? |
Sample config: https://github.com/weserv/images/blob/4.x/config/nginx/conf.d/imagesweserv.conf Dockerfile needs some testing/fine-tuning (we are not using Docker on our dedicated server). |
awesome! Thanks for your Dockerfile and config examples! Im trying deploy with Ubuntu bionic, and your examples with centOS very usefully |
Congrats on your work, lua-vips looks really nice. I'd like to use it with OpenResty, but I want to avoid blocking the main process. Have you done any tests in this area and/or have any ideas on how you would approach this?
The text was updated successfully, but these errors were encountered: