cleverage/enqueue-process-bundle

允许进程包与Enqueue一起工作

v1.0.8 2021-03-08 10:31 UTC

This package is auto-updated.

Last update: 2024-09-08 17:35:34 UTC


README

此包允许您将进程包中的任务连接到一些启动进程的消费者。这允许多线程/并行化进程。

重要提示

使用事件来通知消费者发生了某些事情,当您想等待动作的结果时使用命令。

您需要在配置中静态地将主题和命令映射到本包的消费者,否则它将没有任何通知地简单地不工作。

快速示例

clever_age_process:
    configurations:
        # This process will dispatch events to the queue in a specific topic
        import.csv:
            tasks:
                # ...
                # Series of tasks that output an scalar or an array of scalar
                push_event:
                    service: '@CleverAge\EnqueueProcessBundle\Task\PushEventTask'
                    options:
                        topic: import_denormalize
        
        # This process will receive the output of the previous process through the queue
        import.denormalize:
            tasks:
                # This is just an example
                denormalize:
                    service: '@CleverAge\ProcessBundle\Task\Serialization\DenormalizerTask'
                    options:
                        class: Foo\Bar
                    outputs: [...] # Do stuff

clever_age_process_enqueue:
    topics:
        import_denormalize: # Map a topic to a process
            process: import.denormalize