Code Monkey home page Code Monkey logo

Comments (13)

jimmycuadra avatar jimmycuadra commented on June 10, 2024

I've implemented this in a branch, but as I've been working on it and thinking about it, I'm sort of on the fence about whether it's something that should really be added. The first thing that struck me is that there is currently only one namespace each for "auth" and "users" in Redis. That means that, unless there is some data upgrade path, the usernames/IDs and authorization groups could conflict between different services. There could very well be other cases I haven't thought of that could be problematic when handlers are sharing a backend but not connected to the same service.

It's already possible to run two robots with the same backend by just running two Lita processes with two different config files. I'm not sure I see a downside to doing it that way, other than memory usage, perhaps.

from lita.

zacstewart avatar zacstewart commented on June 10, 2024

You're probably right. Running two dynos just to have a bot in two services sucks though. All the same, if I ran two dynos, why kind of conflicts do you think might arise by sharing the Redis connection. Just auth and users?

I might make a lita-multi gem which can do this, but I'll probably have to re-namespace some stuff in Redis.

from lita.

jimmycuadra avatar jimmycuadra commented on June 10, 2024

Auth and users would definitely have to be namespaced somehow. I couldn't think of a specific example of handler storage conflicting, but the uncertainty about it makes me hesitant to make it a core feature. If you prototype the idea in a gem, I'd certainly be interested in how it goes.

For running two dynos on Heroku, you could deploy each bot to a separate app rather than using two processes on one app. Not as nice as if you were running it on your own machine, but that keeps it free on Heroku.

from lita.

jimmycuadra avatar jimmycuadra commented on June 10, 2024

Closing this for now because I think it's probably best to leave out of core until it's vetted a bit more.

from lita.

zacstewart avatar zacstewart commented on June 10, 2024

👍, I've been thinking about it and hacking on it a little tonight. It probably doesn't belong in the core anyhow if I can put together a module that achieves it.

from lita.

andrusha avatar andrusha commented on June 10, 2024

@zacstewart @jimmycuadra any progress on the multiple adapters? It would be really good to have it.

from lita.

zacstewart avatar zacstewart commented on June 10, 2024

@andrusha, your best bet is probably to run multiple processes and share a Redis instance.

from lita.

andrusha avatar andrusha commented on June 10, 2024

@zacstewart make sense, thanks. That's shame that hubot has this problem too.

from lita.

jimmycuadra avatar jimmycuadra commented on June 10, 2024

I'd like to hear more specifics about use cases for this. What data do you want to share?

from lita.

andrusha avatar andrusha commented on June 10, 2024

@jimmycuadra not sure if I wanted to share anything, it's just that we have both Slack and HipChat and we would like to have bot on both of them, they don't necessary need to share anything except configuration and plugins. It's just easier to manage single deployment.

from lita.

jimmycuadra avatar jimmycuadra commented on June 10, 2024

@andrusha If you don't actually want to share data between the Redis instances for each deployment, you can just use conditions in lita_config.rb to change the relevant adapter configuration while sharing the same Gemfile and handler configuration. I've done this in several cases, for example, to have different settings for development and production.

from lita.

andrusha avatar andrusha commented on June 10, 2024

@jimmycuadra I would imagine that each adapter should have its own namespaces, so they don't clash but you still would only have one but running instead of two and basically one codebase and all.

from lita.

Serhiy-Nazarov avatar Serhiy-Nazarov commented on June 10, 2024

@jimmycuadra
I want to implement bot that communicate few users between each other. But each user can use different adapter. For example one user uses Telegram, next one slack, but at the same moment they should have the same context (karma extantion, as example). How I can do it by the best way?

from lita.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.