Git Product home page Git Product logo

Comments (20)

pcdinh avatar pcdinh commented on September 27, 2024

I understand that Chaussette is a WSGI server which bjoern is. So what is the benefit to integrate them together?

from bjoern.

Natim avatar Natim commented on September 27, 2024

Chaussette is not a WSGI server, it is a WSGI Server wrapper that let give the socket fd as a parameter and use the WSGI server you want to serve the wsgi app.
The aim of adding the bjoern backend is to be able to run a wsgi app using bjoern server.

This is really useful to let circusd server your app using bjoern backend for example.

from bjoern.

Natim avatar Natim commented on September 27, 2024

Here is a circusd configuration example that I would like to be able to use.

[watcher:webworker]
cmd = chaussette --fd $(circus.sockets.webapp) --backend bjoern project.wsgi.application
use_sockets = True
copy_env = True
warmup_delay = 0
numprocesses = 3

[socket:webapp]
host = 127.0.0.1
port = 8888

from bjoern.

pcdinh avatar pcdinh commented on September 27, 2024

So as you explained, Chaussette will sit in front of bjoern. circus will open server socket to accept client connections and pass those connections to Chaussette. Then Chaussette passes them to bjoern

Is that correct?

So many indirections to me. Whap happens if I can pass the file descriptor directly to bjoern without using Chaussette as an intermediate layer?

from bjoern.

Natim avatar Natim commented on September 27, 2024

Yes it would works but then you will rewrite most of the chaussette layer for your bjoern-chaussette like command.

chaussette is a cli command not a python library.

The aim is to be able to run a bjoern WSGI server from the CLI using chaussette

from bjoern.

jonashaag avatar jonashaag commented on September 27, 2024

https://gist.github.com/jonashaag/6548722

bjoern currently doesn't support integer socket fds as argument to listen/run but this could be added easily.

from bjoern.

Natim avatar Natim commented on September 27, 2024

Ok thank you that could be really nice to add the fd argument :)

from bjoern.

tarekziade avatar tarekziade commented on September 27, 2024

👍

from bjoern.

jonashaag avatar jonashaag commented on September 27, 2024

In case of a file descriptor being passed, does Chausette expect the web server to bind() or is this handled by Chausette?

from bjoern.

tarekziade avatar tarekziade commented on September 27, 2024

this is handled by Chaussette. The goal is to set up a pref-fork model where we bind a socket, then fork bjoern workers that accept connection on it - so the system takes care of the load balancing

from bjoern.

gawry avatar gawry commented on September 27, 2024

@jonashaag Are you planning to implement the fd?

from bjoern.

jonashaag avatar jonashaag commented on September 27, 2024

I've begun work on the implementation weeks ago but never really come to finishing it. I'll try to fit it in somewhen in the next few days... no promises...

from bjoern.

Natim avatar Natim commented on September 27, 2024

Thank you for this.

from bjoern.

jonashaag avatar jonashaag commented on September 27, 2024

Just a quick heads-up: I finished implementation (mostly refactoring) and I'm going to test it thoroughly the next few days. It'll be part of the next release

from bjoern.

gawry avatar gawry commented on September 27, 2024

Awesome! Python web apps will be much faster now... :)

On Thursday, November 28, 2013, Jonas Haag wrote:

Just a quick heads-up: I finished implementation (mostly refactoring) and
I'm going to test it thoroughly the next few days. It'll be part of the
next release


Reply to this email directly or view it on GitHubhttps://github.com//issues/73#issuecomment-29457031
.

As informações existentes nessa mensagem e nos arquivos anexados são para
uso restrito, sendo seu sigilo protegido por lei. Caso não seja
destinatário, saiba que leitura, divulgação ou cópia são proibidas. Favor
apagar as informações e notificar o remetente. O uso impróprio será tratado
conforme as normas da empresa e a legislação em vigor.

Antes de imprimir este e-mail/documento, pense em seu compromisso com o
Meio Ambiente

from bjoern.

Natim avatar Natim commented on September 27, 2024

👍

from bjoern.

gawry avatar gawry commented on September 27, 2024

Was this published in pypi? I was trying to write the chaussette part but I couldn't compile from source on my machine neighter get it from pypi

from bjoern.

jonashaag avatar jonashaag commented on September 27, 2024

It's not on PyPI yet. Could you post the compilation errors you get?

from bjoern.

gawry avatar gawry commented on September 27, 2024

Ok, I managed to compile but I couldnt load bjoern.

When I've tried to install with pip I couldn't load bjoern.

pip install -e [email protected]:jonashaag/bjoern.git#egg=bjoern

then I get this error

import bjoern
Traceback (most recent call last):
File "", line 1, in
ImportError: dynamic module does not define init function (initbjoern)

and when I cloned the repository and then python setup.py install thats what I got when trying to import bjoern.

import bjoern
Traceback (most recent call last):
File "", line 1, in
File "bjoern.py", line 3, in
import _bjoern
ImportError: No module named _bjoern

from bjoern.

jonashaag avatar jonashaag commented on September 27, 2024

I haven't updated the setup script yet.

What you need to do is make. That will create a build/_bjoern.so file. You need to add build to your Python path when you import the module, e.g.

make
PYTHONPATH=build python2

from bjoern.

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.