Files
medusa-store/www/apps/resources/app/architectural-modules/event/local/page.mdx
Shahed Nasser 7cb90f8e82 docs: editing and general fixes of medusa's learning resources (#7261)
* docs: editing and general fixes of medusa's learning resources

* fix build script

* update ui dependency

* fix build

* adjust next.js steps
2024-05-13 18:55:11 +03:00

54 lines
1.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
export const metadata = {
title: `Local Event Bus Module`,
}
# {metadata.title}
The Local Event Bus Module uses Node EventEmitter to implement Medusa's pub/sub events system. The Node EventEmitter is limited to a single process environment.
This module is useful for development and testing, but its not recommended to be used in production.
For production, its recommended to use modules like [Redis Event Bus Module](../redis/page.mdx).
---
## Install the Local Event Bus Module
To install Local Event Bus Module, run the following command in the directory of your Medusa application:
```bash npm2yarn
npm install @medusajs/event-local
```
Next, add the module into the `modules` property of the exported object in `medusa-config.js`:
```js title="medusa-config.js"
const { Modules } = require("@medusajs/modules-sdk")
// ...
module.exports = {
// ...
modules: {
// ...
[Modules.EVENT_BUS]: true,
},
}
```
---
## Test the Module
To test the module, start the Medusa application:
```bash npm2yarn
npm run dev
```
You'll see the following message in the terminal's logs:
```bash noCopy noReport
Local Event Bus installed. This is not recommended for production.
```