Give Connection some use, added magic comment to i-mic-rts.rb

This commit is contained in:
2019-10-09 20:43:14 -05:00
parent d6615872ba
commit e67325e831
3 changed files with 22 additions and 2 deletions

View File

@@ -1,9 +1,23 @@
class IMICRTS
class Connection
def initialize(*args)
@pending_orders = []
end
def add_order(order)
@pending_orders.push(order)
end
def update
data = @pending_orders.sort_by { |order| order.tick_id }.map do |order|
# Order serialized size in bytes + serialized order data
[order.serialized_order.length].pack("n") + order.serialized_order
end.join
# p data if data.length > 0
@pending_orders.clear
end
end
end