tsheikh
Developer
Posts: 12
Joined: Thu Jul 28, 2016 12:19 pm

Chat persistence in Web API

Fri Aug 19, 2016 5:07 pm

Is there any good practice to follow when we are developing central web API to respond to user inputs. Remember, we are talking about stateless central service that bridges between SIML and user inputs. Specially, when we are switching among private concepts during the course of conversation. I am concerned about chat persistence. any good example?

User avatar
Leslie
Lead Software Architect
Posts: 353
Joined: Fri Sep 14, 2012 12:20 pm
Contact: Website

Re: Chat persistence in Web API

Fri Aug 19, 2016 7:09 pm

Great question, there's a lot of layer of in-built persistence maintained internally by the Syn.Bot class library during a chat session. From user and bot variables to chat history and context. Are you referring to persistence in chat context?

tsheikh
Developer
Posts: 12
Joined: Thu Jul 28, 2016 12:19 pm

Re: Chat persistence in Web API

Tue Aug 23, 2016 2:08 pm

Yes. In-built layer is valid as long as the instance of bot is available. Once the instance is gone, we don't have data or behavioral persistence. Since REST web API is stateless, any REST action cannot get hold of history by itself i.e. there is not session state for example.

JFYI. I managed this by creating a Singleton bot instance, where bot is supposedly active for the lifetime of web API and for all web requests, hence it persists its state.
Last edited by tsheikh on Tue Aug 23, 2016 4:12 pm, edited 1 time in total.

JeffersonStack
Pro
Posts: 44
Joined: Fri Apr 05, 2013 1:20 am

Re: Chat persistence in Web API

Tue Aug 23, 2016 2:29 pm

I stick with

CSharp Code

SimlBot.Main


for singleton instance.

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest