Members list
Value members
Concrete methods
Utility function for partially ordered results. For example, you might have an interaction where you know that A and B events will happen concurrently, but they'll both occur before C and D. Because A/B and C/D are concurrent, you may get any of:
Utility function for partially ordered results. For example, you might have an interaction where you know that A and B events will happen concurrently, but they'll both occur before C and D. Because A/B and C/D are concurrent, you may get any of:
- List(A, B, C, D)
- List(B, A, C, D)
- List(A, B, D, C)
- List(B, A, C, D)
But that's awkward to match against, and you don't want to just discard ordering.
In this case you could use: val (actual, expected) = partitionAndSort(eventList, List(List(A, B), List(C, D))) assert(actual == expected)
Each chunk will be sorted (to remove concurrent ordering issues), but the order of chunks will be preserved.