Funktionen des Moduls "Descriptor" (experimentell)
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Das protorpc.remote
-Paket bietet folgende Funktionen:
- is_error_status(status)
-
Ermittelt, ob es sich bei dem RPC-Status um einen Fehler handelt.
Argumente
- status
- Initialisierte RpcStatus-Nachricht zur Überprüfung auf Fehler.
- check_rpc_status(status)
-
Wandelt einen Fehlerstatus in eine ausgelöste Ausnahme um.
Argumente
- status
- Initialisierte RpcStatus-Nachricht zur Überprüfung auf Fehler.
Löst einen RpcError aus, wenn der Status von status
ein Fehler ist.
- method ( request_type = message_types.VoidMessage , response_type = message_types.VoidMessage )
-
Stattet eine Methode aus, um sie zur Remote-Methode zu machen.
Argumente
- request_type = message_types.VoidMessage
- Nachrichtentyp der erwarteten Anforderung.
- response_type = message_types.VoidMessage
- Nachrichtentyp der erwarteten Antwort.
Gibt eine ausgestattete Remote-Methode zurück. Die Remote-Methode enthält ein remote
-Attribut mit folgenden Eigenschaften:
- method
- Die ursprüngliche, nicht ausgestattete Methode.
- request_type
- Nachrichtentyp der erwarteten Anforderung.
- response_type
- Nachrichtentyp der erwarteten Antwort.
Löst einen TypeError aus, wenn die Parameter request_type
oder response_type
keine ordnungsgemäßen Unterklassen von message.Message sind.
- get_remote_method(method)
-
Gibt für Remote-Methoden ein Remote-Methoden-Informationsobjekt zurück, andernfalls "None".
Argumente
- method
- Die abzurufende Methode.
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-09-04 (UTC).
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 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."]]