本文整理汇总了Python中threading.Thread.callback方法的典型用法代码示例。如果您正苦于以下问题:Python Thread.callback方法的具体用法?Python Thread.callback怎么用?Python Thread.callback使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类threading.Thread
的用法示例。
在下文中一共展示了Thread.callback方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_unfollow_th
# 需要导入模块: from threading import Thread [as 别名]
# 或者: from threading.Thread import callback [as 别名]
def on_unfollow_th(self, screen_name):
try:
th = Thread(target=self.on_unfollow, args=(screen_name,))
th.callback = self.on_unfollow_cb()
th.start()
except Thread:
print("Error: unable to start unfollow thread")
示例2: on_retweet
# 需要导入模块: from threading import Thread [as 别名]
# 或者: from threading.Thread import callback [as 别名]
def on_retweet(self, tweetbox, tweet_id):
try:
retweet_th = Thread(target=self.twitter.retweet(tweet_id))
retweet_th.callback = tweetbox.on_retweet_cb()
retweet_th.start()
except Thread:
print("Error: unable to start thread")
示例3: on_dm_destroy
# 需要导入模块: from threading import Thread [as 别名]
# 或者: from threading.Thread import callback [as 别名]
def on_dm_destroy(self, tweetbox, dm_id):
try:
dm_destroy_th = Thread(
target=self.twitter.destroy_dm(dm_id))
dm_destroy_th.callback = tweetbox.on_dm_destroy_cb()
dm_destroy_th.start()
except Thread:
print("Error: unable to start thread")
示例4: on_tweet_favorited
# 需要导入模块: from threading import Thread [as 别名]
# 或者: from threading.Thread import callback [as 别名]
def on_tweet_favorited(self, tweetbox, tweet_id, favorite):
try:
tweet_favorited_th = Thread(
target=self.twitter.create_favorite(tweet_id, favorite))
tweet_favorited_th.callback = tweetbox.on_favorite_cb()
tweet_favorited_th.start()
except Thread:
print("Error: unable to start thread")