sangwoo-joh / infer_parallel

The core parallel task runner used by Facebook Infer
Other
1 stars 0 forks source link

What is the top-level interface? #3

Open UnixJunkie opened 8 months ago

UnixJunkie commented 8 months ago

What is the entry point of this library?

You have so many .mli files...

sangwoo-joh commented 8 months ago

Hi @UnixJunkie , You can check out the sample_multiline.ml file for the usage. You can globally open Infer_parallel module or can access explicitly by Infer_paralle.xxx. In short,

  1. First you need to define a ProcessPool.TaskManager. It only supports list now. Please check this for its usage and type.
  2. Then you need a runner. Use Task.Runner.create to create one. Check out this.
  3. Finally, call Task.Runner.run runner with the runner you've created. It will return final results. The second hashtable of the result tuple contains a map of child process id -> last result. I made this change for own my use case so if you don't want this, you can revert 246a2c618a0759ab02448adf6b4b9250bdfcceb1.
UnixJunkie commented 8 months ago

Looks pretty complex, but thanks.

On Fri, Feb 16, 2024 at 5:48 PM Sangwoo Joh @.***> wrote:

Hi @UnixJunkie https://github.com/UnixJunkie , You can check out the sample_multiline.ml https://github.com/sangwoo-joh/infer_parallel/blob/trunk/sample/sample_multiline.ml file for the usage. In short,

  1. First you need to define a ProcessPool.TaskManager. It only supports list now. Please check this https://github.com/sangwoo-joh/infer_parallel/blob/trunk/sample/sample_multiline.ml#L21-L22 for its usage and type.
  2. Then you need a runner. Use Task.Runner.create to create one. Check out this https://github.com/sangwoo-joh/infer_parallel/blob/trunk/sample/sample_multiline.ml#L39-L57 .
  3. Finally, call Task.Runner.run runner with the runner you've created. It will return final results. The second hashtable of result tuple contains a map of child process id -> last result. I made this change for my use case so if you don't want to this type, you can revert 246a2c6 https://github.com/sangwoo-joh/infer_parallel/commit/246a2c618a0759ab02448adf6b4b9250bdfcceb1 .

— Reply to this email directly, view it on GitHub https://github.com/sangwoo-joh/infer_parallel/issues/3#issuecomment-1947976066, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFUFAHAO2FI7ZAIYDKGIIDYT4MINAVCNFSM6AAAAABDLUCMDKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBXHE3TMMBWGY . You are receiving this because you were mentioned.Message ID: @.***>