carb::input::SubscriptionOrder

Defined in carb/input/InputTypes.h

using carb::input::SubscriptionOrder = int32_t

Subscription order.

[0..N-1] requires to insert before the position from the beginning and shift tail on the right. [-1..-N] requires to insert after the position relative from the end and shift head on the left.

Please look at the examples below:

Assume we initially have a queue of N subscribers a b c .. y z: +&#8212;+&#8212;+&#8212;+&#8212; &#8212;+&#8212;+&#8212;+ | a | b | c | | y | z | –&#8212;events&#8212;flow&#8212;> +&#8212;+&#8212;+&#8212;+&#8212; &#8212;+&#8212;+&#8212;+ | 0 | 1 | 2 | |N-2|N-1| &#8212;positive-order&#8212;> +&#8212;+&#8212;+&#8212;+&#8212; &#8212;+&#8212;+&#8212;+ | -N| | | | -2| -1| <&#8212;negative-order&#8212; +&#8212;+&#8212;+&#8212;+&#8212; &#8212;+&#8212;+&#8212;+ first last

After inserting subscriber e with the order 1: +&#8212;+&#8212;+&#8212;+&#8212;+&#8212; &#8212;+&#8212;+&#8212;+ | a | e | b | c | | y | z | +&#8212;+&#8212;+&#8212;+&#8212;+&#8212; &#8212;+&#8212;+&#8212;+ | 0 | 1 | 2 | 3 | |N-1| N | +&#8212;+&#8212;+&#8212;+&#8212;+&#8212; &#8212;+&#8212;+&#8212;+ first last

After inserting subscriber f with the order -1: +&#8212;+&#8212;+&#8212;+&#8212;+&#8212; &#8212;+&#8212;+&#8212;+&#8212;+ | a | e | b | c | | y | z | f | +&#8212;+&#8212;+&#8212;+&#8212;+&#8212; &#8212;+&#8212;+&#8212;+&#8212;+ | 0 | 1 | 2 | 3 | |N-1| N |N+1| +&#8212;+&#8212;+&#8212;+&#8212;+&#8212; &#8212;+&#8212;+&#8212;+&#8212;+ | 0 | 1 | 2 | 3 | |M-3|M-2|M-1| +&#8212;+&#8212;+&#8212;+&#8212;+&#8212; &#8212;+&#8212;+&#8212;+&#8212;+ first last