[rabbitmq-discuss] Rabbit Boot Steps

Alvaro Videla videlalvaro at gmail.com
Sun Jun 19 22:46:04 BST 2011


Hi,

I've extracted the boot steps logic into its own module. I think in this way it might get easier to use by projects outside RabbitMQ.

So far it depends on rabbit_misc:all_module_attributes/1 and rabbit_misc:build_acyclic_graph/3 but they are used in other parts of Rabbit's code so I don't know what's the best approach here.

I've added some specs, I hope they are correct, since is the first time I write those. Also I added extra functionality. So it's possible to have boot steps like -my_app_boot_step and so on. In this way, the prefix can be customized. There's a function boot_steps/1 that will look for the <prefix>_boot_step attributes. If prefix is omitted, then the current application name will be used.

My idea is to extract this module to some library via a Make target in the same way rabbit_common is extracted today.

I've attached the patch and the new module, let me know what you think.

-Alvaro

-------------- next part --------------
A non-text attachment was scrubbed...
Name: boot.diff
Type: application/octet-stream
Size: 3993 bytes
Desc: not available
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110619/b21fa6a0/attachment-0002.obj>
-------------- next part --------------


-------------- next part --------------
A non-text attachment was scrubbed...
Name: rabbit_boot_step.erl
Type: application/octet-stream
Size: 4732 bytes
Desc: not available
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110619/b21fa6a0/attachment-0003.obj>
-------------- next part --------------


On Jun 19, 2011, at 10:56 PM, Matthew Sackman wrote:

> On Sun, Jun 19, 2011 at 09:52:21PM +0200, Alvaro Videla wrote:
>> So, basically rabbit:boot_steps/0 will look for *rabbit_boot_step* declarations in the loaded apps modules, which mean we can use them on plugins right?
> 
> Yup indeed. The nice thing is that that means you can just put the boot
> steps in the relevant locations in your plugins.
> 
>> BTW, I attached a silly patch for rabbit_misc:module_attributes/1 warning message when the module is not defined. I think the function can be used for all kind of attributes an not only boot steps.
> 
> That's correct. We only use it with all the modules that we find - we
> only call it from all_module_attributes, but yes, the error msg is
> overly specific, as you spotted. Thanks.
> 
> Matthew
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss

Sent form my Nokia 1100





More information about the rabbitmq-discuss mailing list