2d2820c9dc71cf17e1efd08177c1001b34b250cf,pubsub/cloud-client/publisher.py,,publish_messages_with_error_handler,#,159

Before Change


    for n in range(1, 10):
        data = u"Message number {}".format(n)
        // Data must be a bytestring
        data = data.encode("utf-8")
        // When you publish a message, the client returns a Future.
        message_future = publisher.publish(topic_path, data=data)
        // If you wish to handle publish failures, do it in the callback.
        // Otherwise, it"s okay to call `message_future.result()` directly.

After Change


        // When you publish a message, the client returns a future.
        future = publisher.publish(
            topic_path,
            data=data.encode("utf-8"),  // data must be a bytestring.
        )
        futures[data] = future
        // Publish failures shall be handled in the callback function.
        future.add_done_callback(get_callback(future, data))

    // Wait for all the publish futures to resolve before exiting.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 3

Instances


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 2d2820c9dc71cf17e1efd08177c1001b34b250cf
Time: 2019-06-20
Author: anguillanneuf@gmail.com
File Name: pubsub/cloud-client/publisher.py
Class Name:
Method Name: publish_messages_with_error_handler


Project Name: naoto0804/pytorch-AdaIN
Commit Name: 32fe84fe95d1dadba882da8deea441919681a566
Time: 2018-05-16
Author: inoue@hal.t.u-tokyo.ac.jp
File Name: net.py
Class Name: Net
Method Name: forward


Project Name: cesium-ml/cesium
Commit Name: 564c92947efc1707287cd63e1379ffcac2813b5a
Time: 2015-01-23
Author: stefan@sun.ac.za
File Name: mltsp/TCP/Software/feature_extract/Code/feature_interfaces.py
Class Name: FeatureInterface
Method Name: find_extname


Project Name: pyinstaller/pyinstaller
Commit Name: 0648769b4fcdd25810c3560dd50409831f3df4c0
Time: 2018-03-13
Author: dustin@virtualroadside.com
File Name: PyInstaller/loader/rthooks/pyi_rth_gdkpixbuf.py
Class Name:
Method Name:


Project Name: invesalius/invesalius3
Commit Name: cd0cef0954f13add478e94eb9795808562db9a0c
Time: 2019-06-19
Author: totonixsame@gmail.com
File Name: invesalius/gui/dicom_preview_panel.py
Class Name: SingleImagePreview
Method Name: ShowSlice