{"action":"created","issue":{"url":"https://api.github.com/repos/grpc/grpc-go/issues/301","labels_url":"https://api.github.com/repos/grpc/grpc-go/issues/301/labels{/name}","comments_url":"https://api.github.com/repos/grpc/grpc-go/issues/301/comments","events_url":"https://api.github.com/repos/grpc/grpc-go/issues/301/events","html_url":"https://github.com/grpc/grpc-go/issues/301","id":102334909,"number":301,"title":"Ability to tie incoming call's Context to an outgoing calls","user":{"login":"mwitkow-io","id":9655971,"avatar_url":"https://avatars.githubusercontent.com/u/9655971?v=3","gravatar_id":"","url":"https://api.github.com/users/mwitkow-io","html_url":"https://github.com/mwitkow-io","followers_url":"https://api.github.com/users/mwitkow-io/followers","following_url":"https://api.github.com/users/mwitkow-io/following{/other_user}","gists_url":"https://api.github.com/users/mwitkow-io/gists{/gist_id}","starred_url":"https://api.github.com/users/mwitkow-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwitkow-io/subscriptions","organizations_url":"https://api.github.com/users/mwitkow-io/orgs","repos_url":"https://api.github.com/users/mwitkow-io/repos","events_url":"https://api.github.com/users/mwitkow-io/events{/privacy}","received_events_url":"https://api.github.com/users/mwitkow-io/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-21T09:11:11Z","updated_at":"2015-08-21T21:39:36Z","closed_at":null,"body":"I'd like to be able to chain RPCs, i.e. make outgoing calls that result from incoming RPCs. \r\n\r\nCurrently, I see no way that I could set the `Context` for an outgoing call that would have it's lifecycle tied to the incoming call. I.e. if the incoming RPC's Context deadlines or is cancelled, the outgoing ones will be cancelled. Ideally, the deadlines set of outgoing RPCs would be set to the remaining deadline of the incoming `Context`\r\n\r\nAdditionally, propagating per-RPC credentials should be easy for both unary and streaming RPCs. Currently it's only possible through manual calls to extract `metadata.MD` from the `Context` and set it on `CallOption.Header`, which only works on unary RPCs.\r\n"},"comment":{"url":"https://api.github.com/repos/grpc/grpc-go/issues/comments/133570106","html_url":"https://github.com/grpc/grpc-go/issues/301#issuecomment-133570106","issue_url":"https://api.github.com/repos/grpc/grpc-go/issues/301","id":133570106,"user":{"login":"iamqizhao","id":10121772,"avatar_url":"https://avatars.githubusercontent.com/u/10121772?v=3","gravatar_id":"","url":"https://api.github.com/users/iamqizhao","html_url":"https://github.com/iamqizhao","followers_url":"https://api.github.com/users/iamqizhao/followers","following_url":"https://api.github.com/users/iamqizhao/following{/other_user}","gists_url":"https://api.github.com/users/iamqizhao/gists{/gist_id}","starred_url":"https://api.github.com/users/iamqizhao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamqizhao/subscriptions","organizations_url":"https://api.github.com/users/iamqizhao/orgs","repos_url":"https://api.github.com/users/iamqizhao/repos","events_url":"https://api.github.com/users/iamqizhao/events{/privacy}","received_events_url":"https://api.github.com/users/iamqizhao/received_events","type":"User","site_admin":false},"created_at":"2015-08-21T21:39:36Z","updated_at":"2015-08-21T21:39:36Z","body":"2. Because streaming rpc does not support CallOption yet.\r\n\r\n1. For unary rpc:\r\n\r\n\tctx := metadata.NewContext(context.Background(), testMetadata)\r\n\tif _, err := tc.EmptyCall(ctx, &testpb.Empty{});\r\n\r\nfor streaming rpc:\r\n\r\n       \ttc := testpb.NewTestServiceClient(cc)\r\n        ctx := metadata.NewContext(context.Background(), testMetadata)\r\n\tstream, err := tc.FullDuplexCall(ctx)"}}