Skip to main content

place_without_answer_is_unknown

Function place_without_answer_is_unknown 

Source
pub async fn place_without_answer_is_unknown<'a, U, D, DFut, R, RFut>(
    ud: &'a U,
    id: &InstrumentId,
    price: Price,
    drive: D,
    release: R,
)
where U: OrderExecutor + ?Sized, D: FnOnce(Pin<Box<dyn Future<Output = Result<OrderAck, Error>> + 'a>>) -> DFut, DFut: Future<Output = Result<OrderAck, Error>> + 'a, R: FnOnce() -> RFut, RFut: Future<Output = ()>,
Expand description

A place the broker never answers is Unknown: not repeated, not Rejected, resolved by asking.

drive receives the future of the place and must run it to its end while making the connector’s request time out (the test holds the answer at the mock and moves the clock past the timeout of the connector). Then:

  1. The outcome is [Error::Unknown].
  2. The same cid again is Rejected(duplicate_place): the library never repeats a place.
  3. release lets the broker finish: the mock took the order after all. order_state(cid) then finds it (retried until it does), and the order is cancelled.

§Panics

With [conformance:place_without_answer_is_unknown] <reason>.