本文整理匯總了Golang中github.com/fmstephe/matching_engine/msg.Message類的典型用法代碼示例。如果您正苦於以下問題:Golang Message類的具體用法?Golang Message怎麽用?Golang Message使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Message類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: write
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))
}
}
示例2: CopyTo
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()
}
示例3: completeNotCancelled
func (m *M) completeNotCancelled(nc *pqueue.OrderNode) {
ncm := msg.Message{}
nc.CopyTo(&ncm)
ncm.Kind = msg.NOT_CANCELLED
m.Out.Write(ncm)
}
示例4: completeCancelled
func (m *M) completeCancelled(c *pqueue.OrderNode) {
cm := msg.Message{}
c.CopyTo(&cm)
cm.Kind = msg.CANCELLED
m.Out.Write(cm)
}