From 5b2da94ba583f647faeff9ee361b19e11f0338e5 Mon Sep 17 00:00:00 2001 From: rht Date: Thu, 20 May 2021 09:21:14 -0400 Subject: [PATCH] slack-bridge: Use threading instead of multiprocessing. This will fix the bug reported in https://chat.zulip.org/#narrow/stream/127-integrations/topic/bridge_with_slack/near/1182555, which is specific to macOS. The error message is ``` AttributeError: Can't pickle local object 'SlackBridge.zulip_to_slack.._zulip_to_slack' ``` --- zulip/integrations/bridge_with_slack/run-slack-bridge | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zulip/integrations/bridge_with_slack/run-slack-bridge b/zulip/integrations/bridge_with_slack/run-slack-bridge index 70b57d4..368351c 100755 --- a/zulip/integrations/bridge_with_slack/run-slack-bridge +++ b/zulip/integrations/bridge_with_slack/run-slack-bridge @@ -5,7 +5,7 @@ import sys import os import argparse import traceback -import multiprocessing as mp +import threading import zulip import slack_sdk from slack_sdk.rtm import RTMClient @@ -123,8 +123,8 @@ if __name__ == "__main__": try: sb = SlackBridge(config) - zp = mp.Process(target=sb.zulip_client.call_on_each_message, args=(sb.zulip_to_slack(),)) - sp = mp.Process(target=sb.run_slack_listener, args=()) + zp = threading.Thread(target=sb.zulip_client.call_on_each_message, args=(sb.zulip_to_slack(),)) + sp = threading.Thread(target=sb.run_slack_listener, args=()) print("Starting message handler on Zulip client") zp.start() print("Starting message handler on Slack client")