-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: central event backbone in the server for analytics #390
Comments
After some discussion with @sfount, this proposed feature accounts for real-time analytics, but does not have a storage mechanism to see "events from today" or "events this week". To account for this, I propose storing events in a database table
... where data is a JSON column that could store variable information. With this new proposal, the client would connect to two server routes:
An additional limitation of this model is that events cannot be shared across cores (since the event emitter will only exist in a single process. Eventually, we could move this event emitter architecture to a shared database like redis. See this example for more information. |
This commit creates an event emitter that will serve events in real-time to any client listeners from throughout the application. The current infrastructure uses the native `events` module in NodeJS, but future implementation might take advantage of redis for publish/subscribe. Closes #390.
This commit adds the class `Topic`, a redis-based event emitter permitting controllers to subscribe/unsubscribe from channels and react to events on those channels. Redis is already an installation requirement for the application, so this adds minimal dependency overhead. The basic usage looks like this: ```js // import Topic const Topic = require('topic'); Topic.subscribe('channelName', (data) => console.log(data)); Topic.publish('channelName, { key : 'value' }); Topic.unsubscribe('channelName'); ``` Closes #390.
This commit adds the class `Topic`, a redis-based event emitter permitting controllers to subscribe/unsubscribe from channels and react to events on those channels. Redis is already an installation requirement for the application, so this adds minimal dependency overhead. The basic usage looks like this: ```js // import Topic const Topic = require('topic'); Topic.subscribe('channelName', (data) => console.log(data)); Topic.publish('channelName, { key : 'value' }); Topic.unsubscribe('channelName'); ``` Closes #390.
This commit adds the class `Topic`, a redis-based event emitter permitting controllers to subscribe/unsubscribe from channels and react to events on those channels. Redis is already an installation requirement for the application, so this adds minimal dependency overhead. The basic usage looks like this: ```js // import Topic const Topic = require('topic'); Topic.subscribe('channelName', (data) => console.log(data)); Topic.publish('channelName, { key : 'value' }); Topic.unsubscribe('channelName'); ``` Closes #390.
This commit adds the class `Topic`, a redis-based event emitter permitting controllers to subscribe/unsubscribe from channels and react to events on those channels. Redis is already an installation requirement for the application, so this adds minimal dependency overhead. The basic usage looks like this: ```js // import Topic const Topic = require('topic'); Topic.subscribe('channelName', (data) => console.log(data)); Topic.publish('channelName, { key : 'value' }); Topic.unsubscribe('channelName'); ``` Closes #390.
This commit adds the class `Topic`, a redis-based event emitter permitting controllers to subscribe/unsubscribe from channels and react to events on those channels. Redis is already an installation requirement for the application, so this adds minimal dependency overhead. The basic usage looks like this: ```js // import Topic const Topic = require('topic'); Topic.subscribe('channelName', (data) => console.log(data)); Topic.publish('channelName, { key : 'value' }); Topic.unsubscribe('channelName'); ``` Closes #390.
One of bhima's central focuses is transparency. This should not be limited to any particular portion of the application, but should run throughout the design of the entire system.
We have the facility to implement real-time analytics on our server/database infrastructure easily via event emitters. Since we have a transitioned into APIs for all data CREATES, UPDATES, and DELETEs, we can capture each of these individual actions initiated by any user and display them to all users that wish to see it.
Design
I propose we implement a new library,
eventd
, that every controller can import and use to broadcast actions that can be captured to write to logs or send to a client via server-sent events. The API will be something like:If we had this infrastructure, you can imagine the ability to quickly add event streams for user login/logout events, database operations, reporting, etc. All of these could be available to power feeds on the client to give real time information about the system.
The text was updated successfully, but these errors were encountered: