Method lrs::msg_queue::MsgQueue::send_timeout

Sends a message over the message queue with a timeout.

Syntax

impl MsgQueue {
    fn send_timeout(&self, msg: &[u8], priority: u16, timeout: Time) -> Result<(), Errno>
}

Arguments

NameDescription
msg

The message to be sent.

priority

The priority of the message.

timeout

Until when this function should block.

Remarks

The priority should be between 0 and i16::max(). The timeout argument is absolute. See the example.

Examples

let flags = FILE_READ_WRITE | FILE_CREATE;
let queue = MsgQueue::open("test", flags, MODE_FILE, None).unwrap();
let timeout = REAL.get_time().unwrap() + Time::seconds(1);
queue.send_timeout("hello, world".as_ref(), 1, timeout));

See also