mirror of
https://github.com/arnaucube/go-dvote.git
synced 2026-02-28 05:26:46 +01:00
Merge pull request #17 from vocdoni/pubsub_testing
explicitly import ipfs-api, declare msg before listen loop
This commit is contained in:
@@ -6,14 +6,17 @@ import (
|
||||
"github.com/vocdoni/dvote-relay/batch"
|
||||
"github.com/vocdoni/dvote-relay/types"
|
||||
"github.com/vocdoni/dvote-relay/data"
|
||||
shell "github.com/ipfs/go-ipfs-api"
|
||||
)
|
||||
|
||||
|
||||
func Sub(topic string) error {
|
||||
subscription := data.PsSubscribe(topic)
|
||||
fmt.Println("Subscribed > " + topic)
|
||||
var msg shell.PubSubRecord
|
||||
var err error
|
||||
for {
|
||||
msg, err := subscription.Next()
|
||||
msg, err = subscription.Next()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user