Skip to content

Instantly share code, notes, and snippets.

@christopherhesse
Created November 20, 2014 00:11
Show Gist options
  • Save christopherhesse/262ba6a29248d06a8f9f to your computer and use it in GitHub Desktop.
Save christopherhesse/262ba6a29248d06a8f9f to your computer and use it in GitHub Desktop.
package hello
import (
"bytes"
"encoding/gob"
"net/http"
"appengine"
"appengine/delay"
)
func init() {
http.HandleFunc("/", handler)
}
type Object struct {
String string
}
func handler(w http.ResponseWriter, r *http.Request) {
c := appengine.NewContext(r)
t, err := laterFunc.Task(Object{})
c.Infof("err=%+v", err)
c.Infof("payload=%s", t.Payload)
buf := &bytes.Buffer{}
args := []interface{}{Object{}}
err = gob.NewEncoder(buf).Encode(args)
c.Infof("err=%+v", err)
c.Infof("payload=%s", buf.Bytes())
}
var laterFunc = delay.Func("key", func(c appengine.Context, obj Object) {
c.Infof("later")
})
@christopherhesse
Copy link
Author

Payload looks like
"payload=*�����
invocation�������Key� ��Args����������[]interface {}�����A����main.go:key���main61029.Object������Object�������String� ����"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment