-
Notifications
You must be signed in to change notification settings - Fork 0
added nodejs tfwconnector which implements the basic connection to th… #1
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
base: master
Are you sure you want to change the base?
Conversation
…e TFW server, and has other good utilities
therealkrispet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added comments to parts that require changes, but the overrall code quality is nice.
therealkrispet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rewrite commit messages to be imparetive, short and start with an uppercase letter
| } | ||
| } | ||
|
|
||
| send(key, data){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MessageSender should not be used to send data, only instructions (clients should use a naked TFWConnector for that (this method should be implemented in TFWServerConnector)
| } | ||
| } | ||
|
|
||
| sendToEventHandlers(message){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MessageSender should not be used to send data, only instructions (clients should use a naked TFWConnector for that (this method should be implemented in TFWServerConnector)
| PUSH_ADDRESS = "tcp://localhost:" + PUSH_PORT; | ||
|
|
||
|
|
||
| class TFWConnector { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be named TFWServerConnector to harmonize with python, cpp and java implementations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MessageSender.send() and MessageSender.sendToEventHandlers() methods should be implemented here as mentioned above (MessageSender is only meant to write instructions).
|
|
||
| class Utilities{ | ||
|
|
||
| constructor(messageSender){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should use a TFWServerConnector instance, not a MessageSender, and should initialise one if the user does not provide one as a parameter.
|
|
||
| class MessageSender{ | ||
|
|
||
| constructor(connector){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
connector should be optional, and if the user does not provide one it should be initialised.
Rename mistyped Connector class Add comment on to_state() method to warn users
…e TFW server, and has other good utilities