CoapRequestBuilder

- Added a `get()` method
This commit is contained in:
Tristan B. Velloza Kildaire 2023-09-14 16:55:50 +02:00
parent 02aa1988be
commit ce3f6240a6
1 changed files with 19 additions and 0 deletions

View File

@ -143,6 +143,25 @@ package class CoapRequestBuilder
// ... and obtain the future
return this.client.doRequest(this);
}
/**
* Build the request, set it in flight
* and return the future handle to it.
*
* This sets the request code to GET.
*
* Returns: the `CoapRequestFuture` for
* this request
*/
public CoapRequestFuture get()
{
// Set the request code to GET
this.requestCode = Code.GET;
// Register the request via the client
// ... and obtain the future
return this.client.doRequest(this);
}
}
import core.sync.mutex : Mutex;