# Run The Inbox Process

### The command

```bash
php artisan inbox:work {topic} 
    --limit=10 
    --log=1|0 
    --wait=5 
    --stop-on-empty 
    --max-processing-time=3600
```

* `{topic}`: The topic that you want to run
* `--limit=10`: The number of msgs that will be pulled from DB to resolve.&#x20;
  * Default: **10**
  * Beware of memory leaks of the high number. Highly recommended: `50` or `100`
* `--log=1|0`: 1 to show up the processing logs, 0 to hide
  * Default: **1**
* `--wait=5`: the interval sleep time (in seconds) when there is no message.&#x20;
  * Default: **5**
* `--max-processing-time=3600`: The inbox process will stop after **X seconds**.&#x20;
  * Default: **3600 (1 hour)**.
  * This is useful because there are still many PHP packages that haven't been optimized for long-lived processes, so it is better to restart the process after a while.
* `--stop-on-empty`: if there is no msg, the inbox process will stop if you include this flag.&#x20;

### Manage the process

Same as Laravel Queue Worker, you can set up the `supervisor` to manage the process.

Note: use `numprocs=1` for each topic.&#x20;

{% hint style="info" %}
We also added the **locking mechanism**, so you won't be able to dispatch multiple processes for a single topic.

This will ensure there is only 1 worker for 1 topic, ensuring your msgs are handled **sequentially and uniquely**.
{% endhint %}
