fix chat event consumption interface change

This commit is contained in:
Asim Aslam
2020-10-19 10:49:05 +01:00
parent 199309e823
commit 00e9b92a14
4 changed files with 12 additions and 4 deletions

View File

@@ -203,7 +203,7 @@ func (c *Chat) Connect(ctx context.Context, stream pb.Chat_ConnectStream) error
// create an event stream to consume messages posted by other users into the chat. we'll use the
// user id as a queue to ensure each user recieves the message
evStream, err := events.Subscribe(chatEventKeyPrefix+chatID, events.WithQueue(userID))
evStream, err := events.Consume(chatEventKeyPrefix+chatID, events.WithGroup(userID))
if err != nil {
logger.Errorf("Error streaming events. Chat ID: %v. Error: %v", chatID, err)
return errors.InternalServerError("chat.Connect.Unknown", "Error connecting to the event stream")

4
go.mod
View File

@@ -3,10 +3,10 @@ module github.com/micro/services
go 1.14
require (
github.com/golang/protobuf v1.4.2
github.com/golang/protobuf v1.4.3
github.com/google/uuid v1.1.2
github.com/gosimple/slug v1.9.0
github.com/micro/micro/v3 v3.0.0-beta.6.0.20201015134940-68ac1ddfa568
github.com/micro/micro/v3 v3.0.0-beta.6.0.20201019094541-f64a46e81eb9
github.com/miekg/dns v1.1.31 // indirect
github.com/ulikunitz/xz v0.5.8 // indirect
golang.org/x/crypto v0.0.0-20201002094018-c90954cbb977 // indirect

9
go.sum
View File

@@ -157,6 +157,8 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
@@ -260,6 +262,10 @@ github.com/mattn/go-tty v0.0.0-20180219170247-931426f7535a/go.mod h1:XPvLUNfbS4f
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/micro/micro/v3 v3.0.0-beta.6.0.20201015134940-68ac1ddfa568 h1:Nz+CWXbuowAMG8GBJYufNCaWoNW0WqN0IohFAdlMGdY=
github.com/micro/micro/v3 v3.0.0-beta.6.0.20201015134940-68ac1ddfa568/go.mod h1:PK1Fa+RtdIVinOLBPgJQJP5Ov8V0ExXx+ywA80f9TdQ=
github.com/micro/micro/v3 v3.0.0-beta.6.0.20201018195347-ca08747a184c h1:VgwGovjOvFMljqo7TNl4wgHfhhTwM8UFUxLeHsb5O6M=
github.com/micro/micro/v3 v3.0.0-beta.6.0.20201018195347-ca08747a184c/go.mod h1:RPJTp9meQAppzW/9jgQtfJmPpRJAySVPbz9uur4B3Ko=
github.com/micro/micro/v3 v3.0.0-beta.6.0.20201019094541-f64a46e81eb9 h1:MDougYikfjfRvY+D2E79pYYSY1KcBbKME/oxf4ofKxk=
github.com/micro/micro/v3 v3.0.0-beta.6.0.20201019094541-f64a46e81eb9/go.mod h1:RPJTp9meQAppzW/9jgQtfJmPpRJAySVPbz9uur4B3Ko=
github.com/miekg/dns v1.1.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
github.com/miekg/dns v1.1.27 h1:aEH/kqUzUxGJ/UHcEKdJY+ugH6WEzsEBBSPa8zuy1aM=
github.com/miekg/dns v1.1.27/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
@@ -693,8 +699,9 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v;L>?3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ=
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=

View File

@@ -1,2 +1,3 @@
package main
//go:generate make proto