Skip to content
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

examples #3

Open
maartenvd opened this issue Oct 11, 2019 · 3 comments
Open

examples #3

maartenvd opened this issue Oct 11, 2019 · 3 comments

Comments

@maartenvd
Copy link

It'd be nice to have some examples on how to use the code. Am I correct in that I need to call

kRPC.Remote.SpaceCenter.ActiveVessel()

to get the active vessel? ie that krpc doesn't reexport everything from remote? (I think this can easily be done using a macro)

also the first constructor for connection gets overwritten, and can be dropped (I can write a pull request if you want)

@BenChung
Copy link
Owner

Sorry, I haven't really prepared this for use by anyone else! Good to hear that someone's trying to use it :). I don't really have time right now to prepare documentation, though, and probably won't for the foreseeable future sadly.

No; kRPC.jl by itself won't import Remote since it doesn't know for sure that it exists when the library itself is loaded and I didn't want to clutter up the namespace. The suggested way to handle this is to add suitable using statements after you open a connection (e.g. using kRPC.Remote.SpaceCenter).

Sure, I'd appreciate a PR for the connection issue.

@maartenvd
Copy link
Author

Hi I oppened the pr, can you also briefly explain to me how to write streams? Or is this not really implemented?

@BenChung
Copy link
Owner

Streams are supported, though listening is rather rudimentary at this point. A stream can be opened by calling add_stream (see streams.jl for reference as to its signature) passing a kPC (which can be constructed through kRPC.Remote.SpaceCenter.Delayed.[your call here] for example). kRPC on the server side doesn't really support "writable" streams per se, so there's no support for doing that here, either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants