-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Real-Time features #119
Comments
@jonathan-casarrubias thanks for bringing this up. Realtime is an important use case for node. As you mentioned, our support for it in 3.x isn't really that powerful. I think that is a result of loopback core trying to do to many things itself instead of making it easy for someone like you to go build something like FireLoop on top of it. Given your experience building FireLoop on LoopBack 3, what sort of things would you like to see in the loopback-next core. Right now we are spending most of our energy with this use case: // controller example
class MyController {
@GET('/echo')
public echo(@inject('msg') msg) {
return msg;
}
} A generic realtime version of this is something like this... // simple realtime example
// server
server.on('connection', connection => {
connection.send('ping')
});
// client
connection.on('message', => {
connection.send('pong');
}); What I'm not so sure about is what the simple realtime example would look like in the context of LoopBack.next... Its worth thinking about the differences between the two examples: controller example is
simple realtime example is
|
@ritch thanks for clarifying, I was unsure about the scope and plans. But from what I read here and in other issues like the ORM one (#117), I think you guys learned not trying to build everything your selves. Also, in FireLoop there is a lot of client side work that I don't think you guys want to deal with, so if I'm correct and we are in the same page, these are the down level features I would expect from you to provide, so we can build more complex interfaces on top like fireloop.
If you provide access to the basic real-time example within the 3 contexts defined above is a good start point.
These are the main 3 points I can think for now, If you manage to provide these it would be helpful. Of course in LB2 and 3 I managed to create a realtime server on my own and distribute that within the different framework's contexts to be able to send the information at the right point, so if you deal with these I can deal with the complex flow and complex client implementations. I'll keep adding more information as I can think on Regards |
There is an interesting server/tech called deepstream.io that is a real-time server that in opinionated to the database it connects to. Their license is going to preclude it from working with Loopback I suspect - however if you look at their core server source it is node.js based. With some elbow grease, someone could hook the two together, perhaps through a dataconnector and listeners to the deepstream events. There would be some work unifying auth and the roles engine so that they align in an easy way too. |
I like this idea, but I think it's probably best implemented as a component rather than a part of the core offerings of loopback-next. Our intent will be to release beta soon(ish), and attempt to keep the component APIs stable so that developers can get a head start on creating their own components. @raymondfeng @bajtos @virkt25 thoughts? |
+1 for implementing this as a component/extension. However, we should ensure that our core is flexible and extensible enough to make this extension easy to build. |
Fwiw, it might be worth looking at feathers. They also have an opinionated model of realtime eventing backing standard CUD operations, like deepstream.io, but they're entirely OSS, I believe. They have some overlap in functionality with the goals of loopback, providing a pretty basic, if extensible ORM with various database connectors, but like loopback-next they have also recently decoupled from express, and it's entirely possible to run feathers purely as a realtime/socket server. I would certainly love to see and would also be interested in contributing to an extension/connector that could bridge the gap between them. |
@jskrzypek i would like to collaborate in this feature from beginning with an extension that provides feat to some controller or method in loopback-next maybe with Socket.io or WebSocket, im trying to figure out yet how works, but already i started working on it here https://github.com/kattsushi/loopback4-extension-socketio based in loopback4-extension-grpc @jonathan-casarrubias has working in this one and he has a broader vision about the extensions, and it seemed like a good starting point |
This issue has been marked stale because it has not seen activity within six months. If you believe this to be in error, please contact one of the code owners, listed in the |
Have you guys started some work on this? I am not an expert, but I would truly like to help |
Hi @collaorodrigo7 thank you for being interested in adding real-time features in LoopBack 4! Maybe we can start with describing our targets: Here are some references may help you: LB4 provides a default rest server to process HTTP requests, see concept server, it also talks about how to customize the sequences and actions to modify the default behaviour. User can also create their own server, see creating server To get familiar with contributing extensions in LoopBack4, we have an example repo that demos various approaches to extend the framework: |
Thanks for the references @jannyHou.
Now, I am not sure if that will be something you guys want or think that will be good to have on lb4 or will be in the scope of the project. I am not sure but I don't think we have connectors for graph databases, do we? Answering your question, I would like to implement the real-time updates keeping in mind offline capabilities. Please consider it is my first time contributing to an open source project, so I have no previous experience, but I will try my best. |
any updates on socket implementation in lb4? |
@matejthetree It's not part of the current scope of work we're doing for General Availability (GA) of the framework. Most likely it will be after that unless you would be interested in helping out by implementing it? The team would be more than happy to help you in any way we can along the way. |
I was thinking of creating just my own socket server and router(like rpc example). How different is this from creating an extension for socket.io If it is not a huge scope, I would be happy to do it. |
Hi, any update about this? |
See #1884 |
This issue has been marked stale because it has not seen activity within six months. If you believe this to be in error, please contact one of the code owners, listed in the |
This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the |
Description/Steps to reproduce
I'm opening this thread to discuss and define a scope for real-time functionalities possibly provided by LB-Next.
Currently there are implemented functionalities like event streams, but honestly are not helpful at all when building real life applications, therefore I have built several real-time approaches on top of loopback, which I believe 2 were the most important.
1.- Implemented PubSub functionality.
2.- Implemented Firebase alike interface.
I want to start the conversation because I know from @ritch expects to provide better RT Interface(s), I will talk about my experiences by sharing the pros and cons I consider from these approaches.
PubSub (Hooking from REST CUD -create, update, delete- Calls)
Pros
Cons
NOTE: Sails.js out of the box offers PubSub events to be subscribed from any REST Endpoint
Firebase alike API
Pros
Cons
That is all I can think for now, but is only to start the conversation... There might be more cons and pros from these 2 approaches I already offer while using the modules I maintain.
Looking forward to see what your plans are on RT Features.
Cheers
Jon
The text was updated successfully, but these errors were encountered: