How to use the uwsgi.spool function in uWSGI

To help you get started, we’ve selected a few uWSGI examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jaysonsantos / django-uwsgi-mail / test_project / uwsgidecorators.py View on Github external
def spool(self, *args, **kwargs):
        arguments = self.base_dict
        if len(args) > 0:
            arguments.update(args[0])
        if kwargs:
            arguments.update(kwargs)
        return uwsgi.spool(arguments)
github unbit / uwsgi / tests / spoolme.py View on Github external
def application(env, start_response):

    name = uwsgi.spool({
        'Hello': 'World',
        'I am a': 'long running task'
    })
    print("spooled as %s" % name)

    start_response('200 Ok', [
        ('Content-Type', 'text/plain'),
        ('uWSGI-Status', 'spooled'),
    ])

    return "task spooled"
github jaysonsantos / django-uwsgi-mail / test_project / uwsgidecorators.py View on Github external
def spool(self, *args, **kwargs):
        arguments = self.base_dict
        arguments['ud_spool_ret'] = str(uwsgi.SPOOL_RETRY)
        if len(args) > 0:
            arguments.update(args[0])
        if kwargs:
            arguments.update(kwargs)
        return uwsgi.spool(arguments)
github unbit / uwsgi / uwsgidecorators.py View on Github external
def __call__(self, *args, **kwargs):
        arguments = self.base_dict.copy()
        if not self.pass_arguments:
            if len(args) > 0:
                arguments.update(args[0])
            if kwargs:
                arguments.update(kwargs)
        else:
            spooler_args = {}
            for key in ('message_dict', 'spooler', 'priority', 'at', 'body'):
                if key in kwargs:
                    spooler_args.update({key: kwargs.pop(key)})
            arguments.update(spooler_args)
            arguments.update(
                {'args': pickle.dumps(args), 'kwargs': pickle.dumps(kwargs)})
        return uwsgi.spool(_encode_to_spooler(arguments))
github unbit / uwsgi / t / spooler / read.py View on Github external
def producer():
    uwsgi.spool(ud_spool_func="consumer", dest=random.choice(projects))
    time.sleep(2)
github 20tab / upy / uwsgidecorators.py View on Github external
def spool(self, *args, **kwargs):
        arguments = self.base_dict
        arguments['ud_spool_ret'] = str(uwsgi.SPOOL_RETRY)
        if len(args) > 0:
            arguments.update(args[0])
        if kwargs:
            arguments.update(kwargs)
        return uwsgi.spool(arguments)
github 20tab / upy / upy / uwsgidecorators.py View on Github external
def spool(self, *args, **kwargs):
        arguments = self.base_dict
        if len(args) > 0:
            arguments.update(args[0])
        if kwargs:
            arguments.update(kwargs)
        return uwsgi.spool(arguments)
github kylewm / redwind / redwind / spool.py View on Github external
def spool(*args, **kwargs):
        import uwsgi
        uwsgi.spool({
            b'f': dumps(f),
            b'args': dumps(args),
            b'kwargs': dumps(kwargs)
        })