Skip to content

Add Rocket.Chat integration #139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add Rocket.Chat integration #139

wants to merge 1 commit into from

Conversation

rht
Copy link
Contributor

@rht rht commented Oct 26, 2017

This is a follow-up from https://chat.zulip.org/#narrow/stream/integrations/subject/Rocket.2Echat.

What is pending is the documentation on how to set this up, lol, since the IRC mirror is about as undocumented as this one. Documentation added.

@rht rht force-pushed the rocket.chat branch 3 times, most recently from d1b6c09 to dd61443 Compare October 30, 2017 23:42

### 2. Rocket.Chat endpoint
1. Create a user
2. Enter the user's username and password into rocket_bridge_config.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it rocket_bridge_config or rocket_mirror_config?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, my mistake it should be rocket_mirror_config (using Zulip's nomenclature).


# A bidirectional mirror
p1 = mp.Process(target=zulip_client.call_on_each_message,
args=(zulip_to_rocket(rocket_client, config),))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might make sense to extract a local here:

zulip_message_handler = zulip_to_rocket(rocket_client, config)  # returns configured function handler
p1 = mp.Process(target=zulip_client.call_on_each_message, zulip_message_handler)
~~

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, addressed.

print("Starting message handler on Rocket.Chat client")
p2.start()

p1.join()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a more idiomatic way to handle two forever-running subprocesses?

Copy link
Contributor Author

@rht rht Nov 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, there is only if one of the client has the feature to be non-blocking. So far, only Matrix does: https://github.com/rht/python-zulip-api/blob/b94bf2a31325243f0c4e5402087f17fca77da79e/zulip/integrations/matrix/matrix_bridge.py#L94.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If zulip_client.call_on_each_message can be made non-blocking, then no multiprocessing is necessary.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually have no problem with these being multiprocess, since the two processes are essentially independent and don't require any coordination. I'm more concerned about tearing them down, so it might make sense to use something like supervisord.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm concerned with the zombie processes even with p.join(). To remain lightweight, what about using multithreading like the Matrix client does[1]?

[1] https://github.com/matrix-org/matrix-python-sdk/blob/cb815ad96c60573f189ead02037f4d1207554717/matrix_client/client.py#L409-L414

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually prefer multiple processes here.

@zulipbot
Copy link
Member

zulipbot commented Dec 1, 2017

Hello @rht, a Zulip maintainer reviewed this pull request over 10 days ago, but you haven't updated your pull request since. Please take a look at the requested changes and update your pull request accordingly.

Thank you for your valuable contributions to Zulip!

4 similar comments
@zulipbot-test
Copy link

Hello @rht, a Zulip maintainer reviewed this pull request over 10 days ago, but you haven't updated your pull request since. Please take a look at the requested changes and update your pull request accordingly.

Thank you for your valuable contributions to Zulip!

@zulipbot
Copy link
Member

Hello @rht, a Zulip maintainer reviewed this pull request over 10 days ago, but you haven't updated your pull request since. Please take a look at the requested changes and update your pull request accordingly.

Thank you for your valuable contributions to Zulip!

@zulipbot-aayush
Copy link

Hello @rht, a Zulip maintainer reviewed this pull request over 10 days ago, but you haven't updated your pull request since. Please take a look at the requested changes and update your pull request accordingly.

Thank you for your valuable contributions to Zulip!

@zulipbot
Copy link
Member

zulipbot commented Mar 5, 2018

Hello @rht, a Zulip maintainer reviewed this pull request over 10 days ago, but you haven't updated your pull request since. Please take a look at the requested changes and update your pull request accordingly.

Thank you for your valuable contributions to Zulip!

@zulipbot-varun
Copy link

@rht A Zulip maintainer reviewed this PR over 10 days ago. Please take a look at the requested changes and update your PR, or leave a comment if you will not be able to do so soon. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants