Skip to content

Commit

Permalink
[worker] Improve sw-proto compatibility, cleanup MP
Browse files Browse the repository at this point in the history
  • Loading branch information
gavento committed Apr 27, 2018
1 parent 4fc7cc6 commit 689da6d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 48 deletions.
51 changes: 10 additions & 41 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ serde_json = "*"
tar = "*"
toml = "*"
walkdir = "*"
rmp-serde = { path="msgpack-rust/rmp-serde" }
rmp = "*"
rmpv = "*"
serde_cbor= "*"
serde_cbor = "*"
serde_bytes = "*"

[build-dependencies]
capnpc = "0.8"
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ extern crate tokio_process;
extern crate tokio_timer;
extern crate tokio_uds;
extern crate walkdir;
extern crate rmp_serde;
extern crate rmpv;
extern crate serde_cbor;
extern crate serde_bytes;

pub mod common;
pub mod worker;
Expand Down
5 changes: 4 additions & 1 deletion src/worker/rpc/subworker_serde.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use common::id::{TaskId, DataObjectId, SubworkerId};
use common::Attributes;
use std::path::PathBuf;
use serde_bytes;

/// Message from subworker to worker.
/// In JSON-equivalent serialized as `{"message": "register", "data": { ... }}`.
Expand Down Expand Up @@ -108,9 +110,10 @@ pub struct DataObjectSpec {
#[serde(rename_all = "camelCase")]
pub enum DataLocation {
/// The data is present in the given path that is relative to the subworker working directory.
Path(String),
Path(PathBuf),
/// The data is directly contained in the message. Only reccomended for
/// small objects (under cca 128kB).
#[serde(with="serde_bytes")]
Memory(Vec<u8>),
/// The data is identical to one of input objects.
/// Only valid in `ResultMsg`.
Expand Down

0 comments on commit 689da6d

Please sign in to comment.