Open charlierudolph opened 7 years ago
I am not against this. Just want to point out that the APIs for both ExoRelay-JS and Exoservice-JS were designed for two very specific use cases:
What is the use-case for the lower-level Exorelay where I get all received messages and then have to do the routing myself?
If we find one, maybe we do a three-way split? (1) low-level Exorelay, (2) high-level Exorelay (1 + message router + reply handling), (3) Exoservice.
I'm suggesting moving high level exorelay into exoservice so it can be used for both (bootstrap for the main services and the ability to create an instance directly for the other methods)
I don't know the low level use case. In the go version, I believe it was in order to abstract away what we always want the exocom libraries to be responsible for (websockets / marshalling messages) and thats it. I believe that was mostly @alexdavid's idea where everything else was pushed out exoservice. I'm not certain if we want
So, the exoservice
NPM module would provide a CLI binary as well as an ExoService
class that one can instantiate in code? In this case, we could merge the ExoRelay into that NPM module as well.
exoservice
no longer has the binary. It has the bootstrap
method for services. Yes, we could technically put all of these into a single exorelay
module that has the three API levels which each build upon each other.
Go currently has low level and high level. JS has mid level and high level
Hard part is what to name each of these. The high level is a bootstrap
method currently. Don't know what the names of mid level and low level instances would be called as each would deal with creating an instance.
What about:
I like exorelay and exoservice. Thoughts on giving the low level the new name. Could be something like ExoConnect
ExoSocket
?
Fine by me
Currently the go and javascript forms are very different in what they are responsible for / what is left in exoservice. I believe this was a result of the very different times they were written and
I think we should make this consistent so that exorelay does the following things
Thus exorelay is left as the low level way of dealing with exocom for anyone that wants to build on top of it instead of using exoservice. This was the idea we went with in the go version
Then we can update exoservice with a few methods:
If accepted, this would involve moving js code from exorelay to exoservice and adding a missing features to go exoservice.@kevgo @alexdavid @hugobho thoughts?