Great, thank you.

>> doesn't seem at all something you absolutely NEED redis to do

What alternative do you recommend to think about?
Serialize data into session? sqlite? ...?

I cannot access the data immediately in controller call (because response 
of third party service + parsing is too slow).
So I need keep lot of data for single session,
and give user delayed short info (with links) which data are prepared:
  - when user requests new page,
  - with js setInterval() and ajax call




Dne pátek 22. dubna 2016 9:23:26 UTC+2 Niphlod napsal(a):
>
> doesn't seem at all something you absolutely NEED redis to do, but feel 
> free to use it.
> You can use an RConn() instance throughout your entire app.
>
> On Friday, April 22, 2016 at 8:53:09 AM UTC+2, Mirek Zvolský wrote:
>>
>> Thank you.
>>
>> What I need is heavy computing related to few users, they DON'T share any 
>> data.
>>
>> User asks a query, some web service gives very long response,
>> and it is necessary to parse it maybe 20s.
>> In this time user can continue work include send next questions.
>>
>> Finally user will receive info, which answers are parsed allready
>> and then he can choose from parsed data.
>> But I don't want save all parsed data to postgres database.
>>
>> I think redis could be good here?
>> With namespaced keys instead of separated db, as you recommend.
>>
>> So I need know, what is minimum for such scenario.
>> Redis + python module installed of course, that already works nice from 
>> python.
>>
>> But in Web2py? Is it necessary to think about threads/queues ?
>> Or import the redis module and make one instance as bellow is enough:
>>
>>> import redis
>>> r = redis.StrictRedis()
>>> r.set(....)
>>
>>
>>
>>
>>
>>
>>
>>
>> Dne čtvrtek 21. dubna 2016 22:27:28 UTC+2 Niphlod napsal(a):
>>>
>>> that machinery is only needed for a module that needs to be used within 
>>> web2py, as cache and session need (and should) use a single object per 
>>> class with namespaced keys. Also, there's really no point or any 
>>> performance benefit on using separate databases in redis, and they're 
>>> unofficially deprecated because they're not working reallty fine with the 
>>> new redis cluster. it's far better to namespace your keys.
>>>
>>> tl;dr: no, RConn() wasn't made with databases preselection in mind, 
>>> mostly because there's no need to.
>>>
>>> On Thursday, April 21, 2016 at 7:41:43 PM UTC+2, Mirek Zvolský wrote:
>>>>
>>>> I try understand how redis support should work.
>>>>
>>>> In the contrib web2py code I see function RConn() with code inside:
>>>>  
>>>>
>>>>> instance_name = 'redis_conn_' + current.request.application
>>>>
>>>> if not hasattr(RConn, instance_name):
>>>>
>>>>     setattr(RConn, instance_name, StrictRedis(*args, **vars))
>>>>
>>>>
>>>> It looks like this should separate (isolate) redis/StrictRedis 
>>>> instances by request.application.
>>>>
>>>> However, if I create 2 redis/StrictRedis instances and save them as 2 
>>>> different variables,
>>>> they will share same data.
>>>> To really separate them, I need set different db=NNN parameter:
>>>>
>>>> r1 = StrictRedis()
>>>> r2 = StrictRedis()
>>>> will be same,
>>>>
>>>> but
>>>> r1 = StrictRedis(db=1)
>>>> r2 = StrictRedis(db=2)
>>>> will be different.
>>>>
>>>> So, is the per application isolation really working?
>>>>
>>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to