Comments (13)
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.
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.
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.
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.
👍, 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.
@zacstewart @jimmycuadra any progress on the multiple adapters? It would be really good to have it.
from lita.
@andrusha, your best bet is probably to run multiple processes and share a Redis instance.
from lita.
@zacstewart make sense, thanks. That's shame that hubot
has this problem too.
from lita.
I'd like to hear more specifics about use cases for this. What data do you want to share?
from lita.
@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.
@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.
@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.
@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)
- send_messages to a room does not work with hipchat HOT 1
- Overriding the default help command HOT 3
- Allow to restrict authorization at the plugin level. HOT 2
- Multiple handlers under namespace block configuration HOT 4
- Proxy
- Custom Handler not loading HOT 4
- Handle the interactive message callback HOT 1
- Hipchat v1 api support removed, any plugin with v2 support ? HOT 1
- Adding HTTP URL for adapters HOT 3
- passthrough has been deprecated log spam HOT 1
- TLS issue HOT 1
- my redis requires user and password, how to set in config? HOT 2
- http.post handler not routing - 404 not found HOT 7
- Lita bot status HOT 7
- New release? HOT 1
- Incorrect I18n.locale inside route HOT 5
- Error when require "lita/rspec" HOT 1
- Redis namespace should be configurable
- Disabling Rack App
- Lita does not mute logger during spec runs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lita.