Here's a demonstration using flatpipes:
extern mod std;
use std::flatpipes;
fn main() {
let (server_chan, server_port) = flatpipes::serial::pipe_stream();
do task::spawn {
let val: @[int] = server_chan.recv();
io::println(fmt!("Value: %?", val));
}
let value = @[1, 2, 3, 4, 5];
server_port.send(value);
}
On Fri, Apr 19, 2013 at 8:50 AM, Patrick Walton <[email protected]> wrote:
> On 4/19/13 7:44 AM, Alexander Stavonin wrote:
>
>> Do we have any possibility to do something like this or only owned
>> values can be send?
>>
>
> You can mark your data as serializable and use flatpipes. This gives you
> the ability to send managed values, at the cost of a copy on send.
> Essentially it's the Erlang model.
>
> I'd like to write a tutorial on this someday.
>
> Patrick
>
> ______________________________**_________________
> Rust-dev mailing list
> [email protected]
> https://mail.mozilla.org/**listinfo/rust-dev<https://mail.mozilla.org/listinfo/rust-dev>
>
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev