Python 2.7 telah mencapai akhir dukungan
dan akan
dihentikan penggunaannya
pada 31 Januari 2026. Setelah penghentian penggunaan, Anda tidak akan dapat men-deploy aplikasi Python 2.7, meskipun organisasi Anda sebelumnya menggunakan kebijakan organisasi untuk mengaktifkan kembali deployment runtime lama. Aplikasi Python 2.7 yang ada akan terus berjalan dan menerima traffic setelah
tanggal penghentiannya. Sebaiknya Anda
bermigrasi ke versi Python terbaru yang didukung.
Fungsi Modul Deskripsi (Eksperimental)
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Paket protorpc.remote
menyediakan fungsi berikut:
- is_error_status(status)
-
Menentukan apakah status RPC adalah error.
Argumen
- status
- Melakukan inisialisasi pesan RpcStatus untuk memeriksa error.
- check_rpc_status(status)
-
Mengonversi status error menjadi pengecualian.
Argumen
- status
- Melakukan inisialisasi pesan RpcStatus untuk memeriksa error.
Memicu RpcError jika status status
merupakan error.
- method(request_type=message_types.VoidMessage, response_type=message_types.VoidMessage)
-
Mendekorasi metode untuk membuat metode tersebut menjadi jarak jauh.
Argumen
- request_type=message_types.VoidMessage
- Jenis pesan dari permintaan yang diharapkan.
- response_type=message_types.VoidMessage
- Jenis pesan respons yang diharapkan.
Menampilkan metode jarak jauh yang didekorasi. Metode jarak jauh akan menyertakan atribut remote
dengan properti berikut:
- metode
- Metode asli tanpa dekorasi
- request_type
- Jenis pesan dari permintaan yang diharapkan.
- response_type
- Jenis pesan respons yang diharapkan.
Memicu TypeError jika parameter request_type
atau response_type
bukan subclass yang tepat untuk messages.Message.
- get_remote_method(metode)
-
Untuk metode jarak jauh, menampilkan objek informasi metode jarak jauh, selain itu Kosong.
Argumen
- metode
- Metode yang akan diambil.
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-09-04 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-04 UTC."],[[["\u003cp\u003e\u003ccode\u003eis_error_status(status)\u003c/code\u003e checks if an \u003ccode\u003eRpcStatus\u003c/code\u003e message indicates an error.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003echeck_rpc_status(status)\u003c/code\u003e raises an \u003ccode\u003eRpcError\u003c/code\u003e exception if the provided \u003ccode\u003eRpcStatus\u003c/code\u003e message indicates an error.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003emethod()\u003c/code\u003e decorates a method to make it remote, defining its request and response message types.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eget_remote_method(method)\u003c/code\u003e retrieves remote method information for a given method or returns \u003ccode\u003eNone\u003c/code\u003e if it's not a remote method.\u003c/p\u003e\n"]]],[],null,["# Descriptor Module Functions (Experimental)\n\nThe `protorpc.remote` package provides the following functions:\n\nis_error_status(status)\n\n: Determines whether the RPC status is an error.\n\n **Arguments**\n\n status\n : Initialized RpcStatus message to check for errors.\n\ncheck_rpc_status(status)\n\n: Converts an error status to a raised exception.\n\n **Arguments**\n\n status\n : Initialized RpcStatus message to check for errors.\n\n Raises an [RpcError](/appengine/docs/legacy/standard/python/tools/protorpc/remote/exceptions#RpcError) if the state of `status` is an error.\n\nmethod(request_type=message_types.VoidMessage, response_type=message_types.VoidMessage)\n\n: Decorates a method for making the method remote.\n\n **Arguments**\n\n request_type=message_types.VoidMessage\n : Message type of the expected request.\n\n response_type=message_types.VoidMessage\n : Message type of the expected response.\n\n Returns a decorated remote method. The remote method will include a `remote` attribute with the following properties:\n\n method\n : The original, undecorated method\n\n request_type\n : Message type of the expected request.\n\n response_type\n : Message type of the expected response.\n\n Raises an [TypeError](http://docs.python.org/library/exceptions.html#exceptions.TypeError) if the `request_type` or `response_type` parameters are not proper subclasses of messages.Message.\n\nget_remote_method(method)\n\n: For remote methods, returns a remote method information object, else None.\n\n **Arguments**\n\n method\n : The method to get."]]