[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-17。"],[],[],null,["# Choosing Pub/Sub or Cloud Tasks\n\nBoth [Cloud Tasks](/tasks/docs/dual-overview) and\n[Pub/Sub](/pubsub/docs/overview) can be used to\nimplement message passing and asynchronous integration. Although they\nare conceptually similar, each is designed for different set of use cases.\nThis page helps you choose the right product for your use case.\n\nKey Differences\n---------------\n\nThe core difference between Pub/Sub and Cloud Tasks is\nin the notion of implicit vs. explicit invocation.\n\nPub/Sub aims to decouple publishers of events and subscribers to those\nevents. Publishers do not need to know anything about their subscribers.\nTherefore, Pub/Sub gives publishers no control over the delivery of the\nmessages save for the guarantee of delivery. In this way, Pub/Sub\nsupports **implicit** invocation: a publisher implicitly causes the subscribers\nto execute by publishing an event.\n\nBy contrast, Cloud Tasks is aimed at **explicit** invocation where\nthe publisher retains full control of execution. In particular, a publisher\nspecifies an endpoint where each message is to be delivered.\n\nOverall Cloud Tasks are appropriate for use cases where\na task producer needs to defer or control the execution timing of a specific\nwebhook or remote procedure call. Pub/Sub is optimal for more general\nevent data ingestion and distribution patterns where some degree of\ncontrol over execution can be sacrificed.\n\nDetailed feature comparison\n---------------------------"]]