besil / kobot

A configurable conversation bot framework, written in Kotlin
Apache License 2.0
16 stars 0 forks source link

Redis session #8

Open besil opened 4 years ago

besil commented 4 years ago

Redis should be used in order to store bot sessions

theShadow89 commented 4 years ago

I want to start to work on this issue.

Actually, the memory layer accepts only BotConfig as a parameter.

Redis requires some additional configuration to work like Redis's hostname and port.

I propose to add an additional parameter to Memory Layer that contains Kobot Configuration.

besil commented 4 years ago

Hi cool!

BotConfig class actually represents the conversation flow, made by states and relationships (the actual graph). Please consider that Spring Boot support has been integrated, so now it's very easy to add parameters.

Have a look at KobotConfig, which reads properties from the application.properties file under the config/ directory.

After declaring a @Bean, you can easily inject it into various classes. For example, take a look at TelegramRunner or KobotRunner.

Feel free to propose a solution or improvements! S.

besil commented 4 years ago

Have a look at the new services

I'm considering to remove actors, since testability is a bit clumsy. While using spring @async features, we could have same performance (on executors) with all the advantages of spring (injection, mocking for tests etc)

besil commented 4 years ago

Working on the jdbc-read, I had to change some interfaces. Due to these changes, now it should be also more straightforward to add Redis: now the MemoryLayer is an interface (MemoryService), so RedisMemoryService should implement it