For the complete documentation index, see llms.txt. This page is also available as Markdown.

WSGI Configuration

If you are using WSGI, you must initialize hackle_client after the process has been forked.

uWSGI

# Step 1: uwsgi.ini 설정
enable-threads = True


# Step 2: app.py 설정
from hackle import hackle
from uwsgidecorators import postfork

class HackleClient:
    client = None

    def init(self):
        if self.client is None:
            self.client = hackle.Client(sdk_key='YOUR_SERVER_SDK_KEY')


hackle_client = HackleClient()


# Step 3: post_fork 설정
@postfork
def post_fork(server, worker):
    hackle_client.init()


# Step 4: hackleClient 사용 시
from app import hackle_client

hackle_client.client.variation(...)

gunicorn

gevent Configuration

If you are changing the internal communication method to non-blocking, such as with gevent monkey patching, you need to delay the instance creation so that the instance is created at the actual call time.

Last updated