mneumann / rust-msgpack

[DEPRECATED] msgpack.org implementation for Rust language. Please use https://github.com/3Hren/msgpack-rust
121 stars 31 forks source link

msgpack-rpc #53

Open anfractuosity opened 9 years ago

anfractuosity commented 9 years ago

I'm just wondering how to use the msgpack-rpc code that's in the repository, or if that's a work-in-progress?

euclio commented 9 years ago

I don't think it's ready to go yet. I'm currently working on a project that would make use of this however, @mneumann, what needs to be done?

mneumann commented 9 years ago

@anfractuosity , @euclio It only parses the RPC messages, but it does not implement the socket infrastructure and the dispatch. Should be easy to do... If you don't need interoperability between different languages, you might also take a look at https://github.com/pcwalton/ipc-channel.

anfractuosity commented 9 years ago

I just had a go at compiling with the RPC module included but got the following error messages, which I'll take a go at fixing.

But I'm wondering after fixing those, roughly what would I need to do to use it? As in how would I define an RPC server interface for clients to call methods from?

   Compiling msgpack v0.1.0 (file:///home/chris/Repositories/rust-msgpack)
src/rpc.rs:2:17: 2:26 error: unresolved import `serialize::Encodable`. Maybe a missing `extern crate serialize`?
src/rpc.rs:2 use serialize::{Encodable, Decodable, Encoder, Decoder};
                             ^~~~~~~~~
src/rpc.rs:2:28: 2:37 error: unresolved import `serialize::Decodable`. Maybe a missing `extern crate serialize`?
src/rpc.rs:2 use serialize::{Encodable, Decodable, Encoder, Decoder};
                                        ^~~~~~~~~
src/rpc.rs:2:39: 2:48 error: unresolved import `serialize::Encoder`. Maybe a missing `extern crate serialize`?
src/rpc.rs:2 use serialize::{Encodable, Decodable, Encoder, Decoder};
                                                   ^~~~~~~~~
src/rpc.rs:2:48: 2:57 error: unresolved import `serialize::Decoder`. Maybe a missing `extern crate serialize`?
src/rpc.rs:2 use serialize::{Encodable, Decodable, Encoder, Decoder};
                                                            ^~~~~~~~~
src/rpc.rs:3:19: 3:26 error: unresolved import `std::old_io::IoError`. Could not find `old_io` in `std`
src/rpc.rs:3 use std::old_io::{IoError, IoResult};
                               ^~~~~~~
src/rpc.rs:3:28: 3:36 error: unresolved import `std::old_io::IoResult`. Could not find `old_io` in `std`
src/rpc.rs:3 use std::old_io::{IoError, IoResult};
                                        ^~~~~~~~
error: aborting due to 6 previous errors
Could not compile `msgpack`.
euclio commented 9 years ago

I mucked around in it a little bit but I'm not familiar with rust serialization at all. After updating the old types it seems that it's using an old interface as well? Or needs more super imports?

mneumann commented 9 years ago

I see. It's still using very old interfaces. At first, serialize is now rustc_serialize. Then of course old_io is gone. I think you should use MsgpackResult instead of IoResult. You will probably find some examples here: https://github.com/rust-lang/rustc-serialize.