-
Notifications
You must be signed in to change notification settings - Fork 13
feature: Add UNIX socket support #49
base: master
Are you sure you want to change the base?
feature: Add UNIX socket support #49
Conversation
I need some help here:
Thank you! |
@mauricioabreu the code is quite nice so far, I will take a proper look tonight and try to answer your questions! |
@marceloboeira Thank you! |
No, thank you for all the support. :) On Fri, Sep 2, 2016 at 10:13 AM Mauricio de Abreu Antunes <
|
I was reading a book these days, "Practical Object-Oriented Design in Ruby". In the beginning of this book the author talks about the case where we create functions that need |
@mauricioabreu the thing is, you can have the If you add this logic and continue to do this for the dependencies, you make the server class handle a lot of functions, which is not what is supposed to do. The best way to do it, in my opinion, would be to have a |
@marceloboeira I was not thinking in adding this code to the server. Just like you said an Address object could handle it. We just use the address to create the socket and logging. Not sure if we actually use the Anyways, I am kinda lost with this PR. Commander needs a default value for every argument. This way I can not check if the user is trying to connect via TCP/IP or UnixSocket. |
I am trying to solve this issue without this refactor (I am not sure if we need to have this refactor). |
Well, one idea is to have a default "empty" for the Unix socket since it is not the default way to run BoJack. |
Basically, what we need is to decide the default interface: Unix/TCP. My opinion, TCP should be the default, then we could have a flag: "--unix", "--use-unix-socket", if the flag is true then hostname as port are ignored. What do you think? less effort and it is backwards compatible. |
@marceloboeira I agree that TCP should be default. |
@mauricioabreu hmm, maybe it is not relevant at all to have the hostname and port in the log after all. |
@marceloboeira For developers/teams who watch logs and take actions on behalf of them it is useful. |
@mauricioabreu in order to make it simple, create a logger initializer that initializes with the socket path, for another formatter, so a formatter for TCP and another for UnixSocket. |
4fa58a6
to
c09da36
Compare
Bad rebase here. |
2a24993
to
b394c95
Compare
Thanks for sharing @marceloboeira I am still trying to solve the code which passes the right socket ahead (UNIXServer or TCPServer). After solving this problem I will get back to the CLI. |
@mauricioabreu yes, I think the |
@marceloboeira thank you! It is good too see how others are handling this problem. |
14b00d2
to
cd28e24
Compare
b394c95
to
4eef8f6
Compare
It looks like I am bad at overloading stuff. 😭 |
Sorry :( bad memory here |
@mauricioabreu no worries, I am actually testing something with the webhooks, that's why I closed and reopened |
@marceloboeira haha :P I am studying crystal again. Maybe it is time to get back to this pull request |
No description provided.