Problem/Motivation
Various workflows could benefit from an ability to prepare and execute commands in separate stages, rather than in one step such as when calling Drupal\http_client_manager\HttpClient::call()
For instance, for reasons of API design, I'm processing some calls using a queue. It would be valuable to leverage Guzzle Service command validation prior to queuing, which is currently impossible due to http_client_manager's design which produces the Guzzle Service command within the call() method.
Decoupling these steps may lead to a means to address Can Guzzle Promise be utilized? (3096785)
Proposed resolution
Provide additional public methods in Drupal\http_client_manager\HttpClientInterface to:
- allow retrieval of the prepared instance of
GuzzleHttp\Command\CommandInterface - allow execution of the command directly
Remaining tasks
I'm going to produce a patch with these changes for your review
API changes
Additional public methods in Drupal\http_client_manager\HttpClientInterface (prepare/execute)
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 3172739-5.patch | 4.26 KB | aronne |
Comments
Comment #2
aronne commentedHi @Electric Doorknob,
it sounds nice to me.
Waiting for your patch :)
Thx,
aronne.
Comment #3
aronne commentedHi there @Electric Doorknob,
any news about the patch you said you were working on?
Kind regards,
aronne.
Comment #4
tyler36 commentedAny progress on this? Happy to review if needed.
Comment #5
aronne commentedHi guys,
sorry for the delay.
I'm gonna upload the patch you were asking for.
Hope that's what you were looking for.
I already tested it and it works fine.
Regards,
aronne
Comment #6
tyler36 commentedPatch #5 applied cleanly to on Drupal
10.1.6with the following HTTP_client_manager versions-
3.1-
9.3.10Tested multiple API calls in Drush with REPL
Admin pages of API are correct and unchanged, as expected.
Thank you.
Comment #8
aronne commentedOk thank you @tyler36,
patch committed on dev branch and is gonna get released soon.
Regards,
aronne