If the above code is run under high concurrency, where multiple calls to ncp are executing in parallel, a given callback function may be invoked multiple times. For example, concurrent calls to:
Copy A -> X
Copy A -> Y
Copy A -> Z
results in three calls to the callback that invokes foo(Z).
(The following was discovered during concurrency testing using loader.io.)
Example:
If the above code is run under high concurrency, where multiple calls to ncp are executing in parallel, a given callback function may be invoked multiple times. For example, concurrent calls to:
Copy A -> X Copy A -> Y Copy A -> Z
results in three calls to the callback that invokes foo(Z).