Skip to content

Instantly share code, notes, and snippets.

View jba's full-sized avatar

Jonathan Amsterdam jba

View GitHub Profile
// Tool to publish messages at intervals, or receive messages.
package main
import (
"flag"
"fmt"
"log"
"os"
"sync/atomic"
"time"
package main
import (
"flag"
"io"
"io/ioutil"
"log"
"net/http"
"net/url"
"sync"
@jba
jba / sub1.go
Last active November 14, 2017 10:17
Using the low-level pubsub client to handle one message at a time
// sub1 receives one message at a time from a subscription.
package main
import (
"context"
"flag"
"log"
"math/rand"
"time"