{"action":"created","issue":{"url":"https://api.github.com/repos/yarpc/yarpc-go/issues/617","repository_url":"https://api.github.com/repos/yarpc/yarpc-go","labels_url":"https://api.github.com/repos/yarpc/yarpc-go/issues/617/labels{/name}","comments_url":"https://api.github.com/repos/yarpc/yarpc-go/issues/617/comments","events_url":"https://api.github.com/repos/yarpc/yarpc-go/issues/617/events","html_url":"https://github.com/yarpc/yarpc-go/issues/617","id":196189983,"number":617,"title":"Discuss removing req/res meta","user":{"login":"breerly","id":263587,"avatar_url":"https://avatars.githubusercontent.com/u/263587?v=3","gravatar_id":"","url":"https://api.github.com/users/breerly","html_url":"https://github.com/breerly","followers_url":"https://api.github.com/users/breerly/followers","following_url":"https://api.github.com/users/breerly/following{/other_user}","gists_url":"https://api.github.com/users/breerly/gists{/gist_id}","starred_url":"https://api.github.com/users/breerly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/breerly/subscriptions","organizations_url":"https://api.github.com/users/breerly/orgs","repos_url":"https://api.github.com/users/breerly/repos","events_url":"https://api.github.com/users/breerly/events{/privacy}","received_events_url":"https://api.github.com/users/breerly/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/yarpc/yarpc-go/milestones/2","html_url":"https://github.com/yarpc/yarpc-go/milestone/2","labels_url":"https://api.github.com/repos/yarpc/yarpc-go/milestones/2/labels","id":1980652,"number":2,"title":"1.0.0","description":"Let's start identifying where we need to get before stabilizing the 1.0.0.","creator":{"login":"breerly","id":263587,"avatar_url":"https://avatars.githubusercontent.com/u/263587?v=3","gravatar_id":"","url":"https://api.github.com/users/breerly","html_url":"https://github.com/breerly","followers_url":"https://api.github.com/users/breerly/followers","following_url":"https://api.github.com/users/breerly/following{/other_user}","gists_url":"https://api.github.com/users/breerly/gists{/gist_id}","starred_url":"https://api.github.com/users/breerly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/breerly/subscriptions","organizations_url":"https://api.github.com/users/breerly/orgs","repos_url":"https://api.github.com/users/breerly/repos","events_url":"https://api.github.com/users/breerly/events{/privacy}","received_events_url":"https://api.github.com/users/breerly/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":51,"state":"open","created_at":"2016-09-02T17:50:11Z","updated_at":"2016-12-17T02:12:40Z","due_on":"2016-12-31T08:00:00Z","closed_at":null},"comments":1,"created_at":"2016-12-17T02:12:40Z","updated_at":"2016-12-19T19:17:52Z","closed_at":null,"body":"What is the API that users expect? I'll bet it's something like this:\r\n\r\n```go\r\nresp, err := client.Call(ctx, req)\r\n```\r\n\r\nand for handlers:\r\n\r\n```go\r\nfunc (handler) Call(ctx context.Context, e *service.Request) (*service.Response, error) {\r\n\treturn &service.Response{}, nil\r\n}\r\n```\r\n\r\nBut what about metadata?\r\n\r\n### Outbound Metadata\r\n\r\nFor outbound metadata, like headers, I think that riding the context is a fine option:\r\n\r\n```go\r\nresp, err := client.Call(yarpc.WithHeaders(ctx, {\"blah\": \"blah\"}), req)\r\n\r\nfunc (handler) Call(ctx context.Context, e *service.Request) (*service.Response, error) {\r\n        headers := yarpc.GetHeaders(ctx)\r\n\treturn &service.Response{}, nil\r\n}\r\n```\r\n\r\n### Inbound Metadata\r\n\r\nFor inbound metadata, we likely need to return *something* from the handler:\r\n\r\n```go\r\nfunc (handler) Call(ctx context.Context, e *service.Request) (*service.Response, yarpc.ResMeta, error) {\r\n\treturn &service.Response{}, nil, nil\r\n}\r\n```\r\n\r\nAnd to receive inbound metadata at outbound callsites, we can use the options pattern:\r\n\r\n```go\r\nresMeta := make(yarpc.ResMeta)\r\nresp, err := client.Call(ctx, req, yarpc.WithResMeta(resMeta))\r\n```\r\n\r\nAlot of this is pseudo-code, but I just wanted to get some ideas out there."},"comment":{"url":"https://api.github.com/repos/yarpc/yarpc-go/issues/comments/268052394","html_url":"https://github.com/yarpc/yarpc-go/issues/617#issuecomment-268052394","issue_url":"https://api.github.com/repos/yarpc/yarpc-go/issues/617","id":268052394,"user":{"login":"kriskowal","id":60294,"avatar_url":"https://avatars.githubusercontent.com/u/60294?v=3","gravatar_id":"","url":"https://api.github.com/users/kriskowal","html_url":"https://github.com/kriskowal","followers_url":"https://api.github.com/users/kriskowal/followers","following_url":"https://api.github.com/users/kriskowal/following{/other_user}","gists_url":"https://api.github.com/users/kriskowal/gists{/gist_id}","starred_url":"https://api.github.com/users/kriskowal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kriskowal/subscriptions","organizations_url":"https://api.github.com/users/kriskowal/orgs","repos_url":"https://api.github.com/users/kriskowal/repos","events_url":"https://api.github.com/users/kriskowal/events{/privacy}","received_events_url":"https://api.github.com/users/kriskowal/received_events","type":"User","site_admin":false},"created_at":"2016-12-19T19:17:52Z","updated_at":"2016-12-19T19:17:52Z","body":"Perhaps the smell with reqMeta and resMeta is the Meta. The metas *are* the request and response, sans body. So maybe this weird trick of naming helps.\r\n\r\n* reqMeta, req -> req, arg\r\n* resMeta, res -> res, ret\r\n\r\nThis and many other inevitable rehashings since the issue is open."}}
{"actor":{"display_login":"kriskowal"}}