-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e9b608
commit 77513e9
Showing
2 changed files
with
35 additions
and
34 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
## Change HTTPClient handler factory creation | ||
|
||
The handler factory for creating handlers for new requests is now provided in the constructor of the client instead of the apply method. This makes it more clear, that the client will use the same handler for all requests. | ||
|
||
The old version would look similar to this: | ||
|
||
```pony | ||
let client = HTTPClient(auth) | ||
// Later | ||
let handler_factory = ... | ||
client(payload, handler_factory)? | ||
// Even later | ||
client(other_payload, other_factory) | ||
``` | ||
|
||
In the new version the handler factory needs to be supplied at the creation of the client: | ||
|
||
```pony | ||
let handler_factory = ... | ||
let client = HTTPClient(auth, handler_factory) | ||
client(payload) | ||
// This will use the handler_factory | ||
client(other_payload) | ||
// To use a different handler factory, create a new client | ||
let other_client = Client(auth, other_factory) | ||
other_client(other_payload) | ||
``` | ||
|