func (r *inMemoryResponder) write(m *msg.Message) { b := make([]byte, msg.SizeofMessage) m.WriteTo(b) n, err := r.writer.Write(b) if err != nil { r.handleError(err.Error()) } if n != msg.SizeofMessage { r.handleError(fmt.Sprintf("Write Error: Wrong sized message. Found %d, expecting %d", n, msg.SizeofMessage)) } }
func (o *OrderNode) CopyTo(to *msg.Message) { to.Kind = o.Kind() to.Price = o.Price() to.Amount = o.Amount() to.TraderId = o.TraderId() to.TradeId = o.TradeId() to.StockId = o.StockId() }
func (m *M) completeNotCancelled(nc *pqueue.OrderNode) { ncm := msg.Message{} nc.CopyTo(&ncm) ncm.Kind = msg.NOT_CANCELLED m.Out.Write(ncm) }
func (m *M) completeCancelled(c *pqueue.OrderNode) { cm := msg.Message{} c.CopyTo(&cm) cm.Kind = msg.CANCELLED m.Out.Write(cm) }