Skip to content

Commit

Permalink
apply bin codec for enqueue messages
Browse files Browse the repository at this point in the history
  • Loading branch information
fogfish committed Sep 25, 2024
1 parent c904724 commit 5a2423d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions queue/bytes/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,15 @@ type queue struct {
func (q queue) Put(object []byte) error { return q.Enq(q.cat, object) }

func (q queue) Enq(cat string, object []byte) error {
obj, err := q.codec.Encode(object)
if err != nil {
return err
}

ctx := swarm.NewContext(context.Background(), cat, "")
bag := swarm.Bag{Ctx: ctx, Object: object}
bag := swarm.Bag{Ctx: ctx, Object: obj}

err := q.emit.Enq(bag)
err = q.emit.Enq(bag)
if err != nil {
return err
}
Expand Down

0 comments on commit 5a2423d

Please sign in to comment.