Sorry, was on my phone. Hopefully some sample code will better illustrate
what I'm thinking:

loop {
  let result : Result<Foo, ()> = task::try(proc() {
    loop {
      recv_msg(); // begin latency sensitive part
      process_msg();
      send_msg (); // end latency sensitive part
    }
  });

  if result.is_ok() {
    return result;
  } else {
    continue;
  }
}

This way, you only pay for the try if you have a failure (which should
hopefully be infrequently), and you get nice task isolation!


On Wed, Mar 26, 2014 at 6:05 PM, Clark Gaebel <cg.wowus...@gmail.com> wrote:

> The "main loop" of your latency sensitive application.
> On Mar 26, 2014 5:56 PM, "Phil Dawes" <rustp...@phildawes.net> wrote:
>
>> On Wed, Mar 26, 2014 at 9:44 PM, Clark Gaebel <cg.wowus...@gmail.com>wrote:
>>
>>> Can't you put that outside your inner loop?
>>>
>>
>> Sorry Clark, you've lost me. Which inner loop?
>>
>> _______________________________________________
>> Rust-dev mailing list
>> Rust-dev@mozilla.org
>> https://mail.mozilla.org/listinfo/rust-dev
>>
>>


-- 
Clark.

Key ID     : 0x78099922
Fingerprint: B292 493C 51AE F3AB D016  DD04 E5E3 C36F 5534 F907
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to