About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
UserMessenger
class UserMessenger
Bases: object
Base class for handling communication with program users.
This class can be used when writing a new Qiskit Runtime program.
Methods
publish
UserMessenger.publish(message, encoder=<class 'qiskit.providers.ibmq.runtime.utils.RuntimeEncoder'>, final=False)
Publish message.
You can use this method to publish messages, such as interim and final results, to the program user. The messages will be made immediately available to the user, but they may choose not to receive the messages.
The final parameter is used to indicate whether the message is the final result of the program. Final results may be processed differently from interim results.
Parameters
- message (
Any
) – Message to be published. Can be any type. - encoder (
Type
[JSONEncoder
]) – An optional JSON encoder for serializing - final (
bool
) – Whether the message being published is the final result.
Return type
None
Was this page helpful?
Report a bug or request content on GitHub.