-
-
Save christopherhesse/262ba6a29248d06a8f9f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Payload looks like
"payload=*�����
invocation�������Key���Args����������[]interface {}�����A����main.go:key���main61029.Object������Object�������String�����"