-
Notifications
You must be signed in to change notification settings - Fork 36
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
ipc command & native control interface #54
Conversation
…stop) & IPC command
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.
LGTM
…l-so. Also, added .DS_Store to .gitignore
Can this be merged into the base branch? |
^ @raulk |
I see no reason why not to, and @vyzo has already LGTM’d. As we continue hacking on this, there’ll be opportunities to revisit if needed. I’ll just go ahead and merge. Sorry for the delay – Santa and the Three Wise Kings called. |
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.
@@ -54,6 +57,15 @@ func NewDaemon(ctx context.Context, path string, opts ...libp2p.Option) (*Daemon | |||
|
|||
go d.listen() | |||
|
|||
sigc := make(chan os.Signal, 1) | |||
signal.Notify(sigc, os.Interrupt, syscall.SIGTERM) | |||
go func(ln net.Listener, c chan os.Signal) { |
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.
Nice one for an orderly shutdown.
) | ||
|
||
// DaemonConfig defines the configuration options | ||
type DaemonConfig struct { |
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.
Eventually I'd like us to bring in some grouping/organisation to the daemon config, but definitely not a showstopper here. See related: #35.
This PR simply packages the libp2p-dameon as a shared object and exposes a simple native control interface with two methods:
The control interface is still managed via IPC
Build Instructions:
Run the daemon from Java
Run the daemon from Go