Priority list in buffer

Is it possible in any way to crate a priority list in a buffer to modify the output order depending on the products component property?

For example if product2 with prop=2 enters the buffer after product1 with prop=4, product2 will get prioritised over product1 and leave the buffer before product1 as the value of prop is lower for product2.

Thanks in advanced,
OLLE