-
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
Daemon as shared library. #20
Comments
So the idea would be to compile the daemon down to a shared library. This wouldn't be too efficient, because to my knowledge, the library will embed the Go runtime. Anybody knows if this would be possible with little effort? Browsing Would it be so simple as keeping everything as-is, and creating |
@bigs @vyzo @Stebalien – any clue here? |
Yeah, this actually looks like it might work. |
yep. as long as the exported interface is very simple (like the start/stop) i think it should work |
I assume we'd expose the API, right? That is, start, stop, newstream (returns a handle), close, read, write, reset, etc... |
@Stebalien, nope, the only API exposed is |
This sounds like a very reasonable. We should be able to export Start/Stop functions for embedding in the application. |
I like the idea of packaging this as an .so and have an immediate need for it. I am going to see if I have time to prove this idea out this week. |
thanks! happy to review once it’s up.
cole
…On Nov 20, 2018, 11:51 AM -0500, Jonny Rhea ***@***.***>, wrote:
I like the idea of packaging this as an .so and have an immediate need for it. I am going to see if I have time to prove this idea out this week.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
i created a .so and exported a
Thanks, |
There are some example programs you can use as a starting point for testing in gerbil-libp2p/example. |
Re-opening as reference and possible request for comment for same Nim repo issue: vacp2p/nim-libp2p#21 |
Is this still a requested feature? It seems to me like a large amount of the functionality could be achieved by using go-libp2p as a shared library and not the daemon itself, or by just running the daemon and then writing a client api for a target language. Feel free to reopen if this is still a requested feature. |
In most of the cases daemon usage is fine, but sometimes your project could not spawn actual daemon executable. Is it possible to wrap the daemon inside of simple shared library, this library can export for example just two functions
start(configuration)
andstop()
.So when application loads shared library and calls to
start(configuration)
daemon'smain()
function will be executed in new thread (or in any other possible ways). In such case all the named sockets created will be inside of application, so it can be possible to use daemon in iOS (for example).This is of course not priority issue, but it would be very handy to have such feature.
The text was updated successfully, but these errors were encountered: