mhauri / magento-slack

Magento Slack allows you to send notifications events to a Slack channel.
http://magehero.com/posts/885/hipchat-and-slack-magento-extension
MIT License
26 stars 7 forks source link

Please switch to an asynchronous operation mode #1

Closed SchumacherFM closed 9 years ago

SchumacherFM commented 9 years ago

Cool idea! :+1:

But ... as far as I can see here (https://github.com/mhauri/magento-slack/blob/master/app%2Fcode%2Fcommunity%2FMhauri%2FSlack%2FModel%2FObserver.php#L54) all requests to Slack happens synchronously.

What if the Slack host isn't available or there is a routing problem to the Slack server? The customer will get annoyed because the frontend loads to slow or any other Slack related error ouccurs. The store owner loses money.

For example: move this messaging service into a cronjob and use a 3rd table (three columns: entity_type, entity_id, sent) to check if the order/customer/etc has already been reported.

Or: Store the generated JSON (e.g. https://github.com/mhauri/magento-slack/blob/master/app%2Fcode%2Fcommunity%2FMhauri%2FSlack%2FModel%2FObserver.php#L44) in a Redis instance (or DB table) and then => cronjob. The classical messaging queue.

:blush:

mhauri commented 9 years ago

Fixed in Version 0.4.0