CodeDredd/laravel-soap

Delay between requests

programulin opened this issue · 2 comments

Some SOAP services have requirements about max requests count, like not more 1 request in 0.25 sec.

What about to make new method that set delay between requests? Like:

$client = Http::baseWsdl('wsdl')->delay(0.25);

$client->call('first');
$client->call('second'); // this method will be called in 0.25sec after getting previous response

I think most advantage of that functional in tests, where delay can be disabled (by default?):

Soap::fake()->enableDelay();

As alternative - maybe callbacks that will be called before every request, like:

$client = Http::baseWsdl('wsdl')
    ->before(function(string $method_name, Request $request, bool $is_fake) {
        if($method_name === 'GetBigData' && $is_fake) {
            usleep(250000);
        }
    });
stale commented

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

stale commented

Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Laravel Soap!