-
Notifications
You must be signed in to change notification settings - Fork 5
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
Pass in dependencies to ssb-conn
#27
Comments
Hey @pietgeursen that's super interesting that you're about to make a connHub in Rust. Keen to see what you come up with! About the suggestion, how do you intend to call the CONN constructor? It is a secret-stack plugin, so it has the arguments (Note that the interfaces should be defined already in the |
Ooof, good point. Well in that case, arguments 5,6,7 and 8? It's disgusting, I know. But we can declare multiple constructors and document them for clarity. Would you be up for that?
🎉 |
Could I first know what's your thoughts on this question?
|
It depends if you're talking about my code or "you" more generally. If you mean me specifically: More generally: |
I went looking for these but I'm not seeing them in the source. I'm sure I must be missing something. |
I see, thanks. I'm concerned that adding these constructor parameters is going to come back and bite us when using CONN as a secret-stack plugin (the main use case). (It's easy to just add a new use case, it's hard to maintain that use case and all other use cases in the long-term future). Since we're in disgusting territory, can we consider other (maybe equally disgusting) options? CONN (as a class) is just a light wrapper around DB,Hub,Staging,Scheduler and as a wrapper it's intended as a secret-stack plugin. Since you want something that is not secret-stack plugin, how about you just copy-paste
It's this and in TypeScript you can use (I guess) |
Yeah. Obviously I was hoping to avoid duplicating modules. But I can make a fork and change the constructor, that's ok too. |
Hey @staltz 👋
Would you be open to merging a PR that allows the caller to pass in
ConnHub
,ConnDb
,ConnStaging
andConnQuery
instances to theCONN
constructor?I was thinking of something like:
I
in my examples)ssb-conn
construction to be something like:I'm tryingg to build up some microservices with a combination of rust and js modules. I'd like to use ssb-conn and friends but I'd need to be able substitute ssb-conn-hub for some rust code I have.
I'm happy to do the work btw, just checking if you're on board with the general idea.
The text was updated successfully, but these errors were encountered: