[prev in list] [next in list] [prev in thread] [next in thread] 

List:       uwsgi
Subject:    Re: [uWSGI] Cache function questions from Python module
From:       Roberto De Ioris <roberto () unbit ! it>
Date:       2018-03-17 7:17:55
Message-ID: 6d6957b9570350fb8106338eb8c1c4c7.squirrel () squirrelmail ! unbit ! it
[Download RAW message or body]


> I'm starting to use the cache_* functions from a Flask app, and
> noticed that the documentation of what's available seems incomplete.
> (I'm using uWSGI 2.0.14.) From a running pyshell, I can see the
> following functions: cache_clear, cache_dec, cache_del, cache_div,
> cache_exists, cache_get, cache_inc, cache_keys, cache_mul, cache_num,
> cache_set, and cache_update.
>
> Asking for help on any of them just returns "...". Some are documented
> on this page:
>
> https://uwsgi-docs.readthedocs.io/en/latest/PythonModule.html
>
> but cache_dec, cache_div, cache_inc, cache_keys, cache_mul, and
> cache_num aren't mentioned at all. cache_update and cache_clear are
> mentioned by name, but not described.
>
> It wasn't initially obvious to me what cache_update is for (figured
> that out - replace an existing entry instead of introducing a
> duplicate), and its function call signature in the documentation
> introduces an undefined parameter named "cache_server", which I think
> probably should be "cache_name" for consistency.
>
> Are these functions documented somewhere else I haven't discovered,
> maybe their non-Python C equivalents?
>
> Is it possible to enumerate the various caches through the Python API?
>
> Before I go off and start digging and writing, are more documentation
> updates in the mill besides this pull request?
>
> https://github.com/unbit/uwsgi-docs/pull/395
>
> Thx,
>

Hi, the most updated stuff is only available in the sources:
https://github.com/unbit/uwsgi/blob/master/plugins/python/uwsgi_pymodule.c#L3511

the functions should be easy to follow even for a non-C programmer.

Yes, the cache_server should be cache_name.

The inc/dec/mul/... functions are for "atomic" math operations (a lock
will allow inter-process safety)

-- 
Roberto De Ioris
http://unbit.com
_______________________________________________
uWSGI mailing list
uWSGI@lists.unbit.it
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic