示例#1
0
文件: message.go 项目: jmptrader/pluq
func reply(ctx context.Context, w http.ResponseWriter, r *http.Request) error {
	eid, err := uid.FromHashID(param.FromContext(ctx, "id"))
	if err != nil {
		return err
	}
	q := queue.FromContext(ctx)
	if err := q.Ack(eid); err != nil {
		return err
	}
	fmt.Fprintf(w, "ok")
	return nil
}
示例#2
0
文件: server.go 项目: jmptrader/pluq
func queueName(ctx context.Context) string {
	return strings.Trim(param.FromContext(ctx, "queue"), "/")
}