Hey Ryan. 
The problem is actually not specific to pytransitions. But anyways, I 
wanted to persist an object in memory and not have to retrieve it from the 
DB every time. Although I'm not sure which is better for scaling (please 
give suggestions if you know more). As for recovering state, I'm planning 
to store the state in a session variable as a fail safe.

On Sunday, June 10, 2018 at 7:07:23 AM UTC+5:30, Ryan Nowakowski wrote:
>
> I've never used pytransitions. Typically persistent state in Django is 
> stored in the model instead of objects in memory. This allows you to easily 
> scale and also recover state if your app process stops.
>
> On June 9, 2018 1:01:14 AM CDT, Rithwik Cherian <rhk...@gmail.com 
> <javascript:>> wrote:
>>
>> Hello all,
>>
>> Very excited to discover the Channels project. I think it could be 
>> exactly what I was looking for. I am going through the documentation and 
>> seeing how it works right now, but I would really appreciate if someone 
>> could tell me if it will help me do what I want.
>>
>> I am making a chatbot, which is state dependent. The dialogue delivery 
>> and state management is handled by a Finite State Machine built using the 
>> transitions (pytransitions <https://github.com/pytransitions/transitions>) 
>> library. So my chatbot is a python object, which transitions from one state 
>> to another based on the users input. So to run the chatbot (per user per 
>> session) I need something exactly like the scope provided by channels, 
>> something that lasts for more than one request. 
>>
>> My question is *if I can have a python object instantiated per scope and 
>> have it persist for the duration of the scope*, so that for each user I 
>> can have a different object keeping track of which state the user is in and 
>> returning responses based on the state?
>>
>> Any help would be appreciated, as I am very inexperienced on things 
>> related to web (websockets, WSGI, ASGI etc.).
>>
>> Thanks.
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cc8f52ad-4874-4345-a8e4-905b63f42f39%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to