{"id":15150369,"url":"https://github.com/matttproud/contextualizing-contexts","last_synced_at":"2026-02-07T15:02:50.683Z","repository":{"id":249439362,"uuid":"831437051","full_name":"matttproud/contextualizing-contexts","owner":"matttproud","description":"Demonstrate and explain vagaries of Go's context API.","archived":false,"fork":false,"pushed_at":"2024-07-22T14:39:26.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T05:49:37.298Z","etag":null,"topics":["go","grpc","grpc-go","http"],"latest_commit_sha":null,"homepage":"https://matttproud.com","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matttproud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-20T14:44:42.000Z","updated_at":"2024-07-22T14:39:30.000Z","dependencies_parsed_at":"2024-11-27T10:15:11.064Z","dependency_job_id":null,"html_url":"https://github.com/matttproud/contextualizing-contexts","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"d8e5aec252b54b8a82ecb941743f70c64dd89c43"},"previous_names":["matttproud/contextualizing-contexts"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/matttproud/contextualizing-contexts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matttproud%2Fcontextualizing-contexts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matttproud%2Fcontextualizing-contexts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matttproud%2Fcontextualizing-contexts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matttproud%2Fcontextualizing-contexts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matttproud","download_url":"https://codeload.github.com/matttproud/contextualizing-contexts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matttproud%2Fcontextualizing-contexts/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265121267,"owners_count":23714500,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","grpc","grpc-go","http"],"created_at":"2024-09-26T14:02:55.668Z","updated_at":"2026-02-07T15:02:45.653Z","avatar_url":"https://github.com/matttproud.png","language":"Go","readme":"This repository contains code samples to demonstrate vagaries around Go's\ncontext API.\n\n## Structure\n\n* `{grpc,http}-in-series`: shows the behavior of a function with *manual\n  deadline* management juxtaposed with the context's native cancellation\n  mechanisms as implemented respectively through gRPC and HTTP server libraries.\n\n* `{grpc,http}-branch`: shows the behavior of the same function from\n  `{grpc,http}-in-series` run in a separate goroutine from the respective server\n  libraries to connect how the server's dispatch functions handle context\n  lifetime.\n\n* `{grpc,http}-notify`: shows the lifetime behaviors of the context from the\n  respective server libraries to establish when lifetime begins and ends in\n  isolation.\n\n* `{grpc,http}-deadline`: reveals what deadline the server library attaches to\n  the context (if any).\n\n  `http-deadline-synth` demonstrates a deadline with the HTTP stack using\n  a homegrown `X-MTP-Deadline` request header (uses `http.TimeFormat` values).\n\n  ```\n  $ curl -H \"X-MTP-Deadline: $(LC_ALL=C TZ=GMT date -d 'now + 1 minutes' '+%a, %d %b %Y %T %Z')\" localhost:8080\n  ```\n\n* `{grpc,http}-complete`: these combine respectively\n  `{grpc,http}-{branch,deadline,notify}` and `http-deadline-synth` into one\n  server to show you all of the moving parts of the original quiz.\n\nThe server samples serve on `localhost:8080`:\n\n* Clients can exercise the HTTP servers with curl:\n\n  ```\n  $ curl localhost:8080\n  ```\n\n* Clients can exercise the gRPC servers the gRPC CLI ([`grpc_cli`]):\n\n  ```\n  $ grpc_cli call localhost:8080 proto.Test.Exercise ''\n  ```\n\nTry exercising the gRPC servers with varying values of the `grpc_cli`'s\n`--timeout` flag.  There is [no default timeout/deadline].\n\n[`grpc_cli`]: https://github.com/grpc/grpc/blob/master/doc/command_line_tool.md\n[no default timeout/deadline]: https://grpc.io/docs/guides/deadlines/#deadlines-on-the-client","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatttproud%2Fcontextualizing-contexts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatttproud%2Fcontextualizing-contexts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatttproud%2Fcontextualizing-contexts/lists"}