This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void serialisePublishing(final long sequence, | |
final Sequence cursor, | |
final int batchSize) { | |
final long expectedSequence = sequence - batchSize; | |
while (expectedSequence != cursor.get()) { | |
// busy spin | |
} | |
cursor.set(sequence); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public long incrementAndGet(AtomicLong atomic) { | |
long expected; | |
long updated | |
do { | |
expected = atomic.get(); | |
updated = expected + 1; | |
} | |
while (!atomic.compareAndSet(expected, updated)); | |
return updated; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ExecutionTracking implements OrderEventListener, ExecutionEventListener | |
{ | |
private final Session tradingSession; | |
final Map<Long, Order> lastOrderStateByInstructionId = new HashMap<Long, Order>(); | |
Order currentOrder = null; | |
long currentFilledQuantity; | |
long currentCancelledQuantity; | |
public ExecutionTracking(final Session tradingSession) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<order> | |
<timeInForce>ImmediateOrCancel</timeInForce> | |
<instructionId>1733844027851145216</instructionId> | |
<originalInstructionId>1733844027851145216</originalInstructionId> | |
<orderId>AAK8oAAAAAAAAAAF</orderId> | |
<accountId>1393236922</accountId> | |
<instrumentId>179361</instrumentId> | |
<quantity>30</quantity> | |
<matchedQuantity>30</matchedQuantity> | |
<matchedCost>22.1</matchedCost> |
NewerOlder