Skip to content

Instantly share code, notes, and snippets.

@sijie
Created July 9, 2019 07:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sijie/8e3bdd6aa208d742c520f0f8a351a858 to your computer and use it in GitHub Desktop.
Save sijie/8e3bdd6aa208d742c520f0f8a351a858 to your computer and use it in GitHub Desktop.
Pulsar Go Function example
import (
  "fmt"
  "context"
  "github.com/apache/pulsar/pulsar-function-go/pf"
)

func HandleRequest(ctx context.Context, in []byte) error {
  fmt.Println(string(in) + "!")
  return nil
}

func main() {
  pf.Start(HandleRequest)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment