Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed timer configuration, not required #33

Merged
merged 1 commit into from
May 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions repository/blocks/EnhancedHttpOutputBlock.mon
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@ using com.softwareag.connectivity.httpclient.Response;
event HTTPHandler
{
string deviceId;
float timeout;
string host;
/** Handle the HTTP response.*/
action handleResponse(Response res) {
// $base.createTimer(($parameters.timeout.toFloat() / 1000.0), res); // Creates a timer with the specified duration.
TimerParams tp := TimerParams.relative(timeout).withPayload(res).withPartition(deviceId);
// $base.createTimer(0.01, res); // Creates a timer with the specified duration.
TimerParams tp := TimerParams.relative(0.01).withPayload(res).withPartition(deviceId);

log "Called handleResponse: " + res.payload.data.toString() at INFO;
if not res.isSuccess() {
Expand Down Expand Up @@ -88,15 +87,6 @@ event EnhancedHTTPOutput_$Parameters {
/**Default value for wrapBody.*/
constant boolean $DEFAULT_wrapBody := true;

/**
* Timeout.
*
* The timeout in ms for the call.
*/
integer timeout;
/**Default value for timeout.*/
constant integer $DEFAULT_timeout := 1; // 1ms

/** Validate that the values for all the parameters have been provided. */
action $validate() {
BlockBase.throwsOnEmpty(host, "host", self);
Expand Down Expand Up @@ -196,7 +186,7 @@ event EnhancedHTTPOutput {
// Execute the request and pass the callback action.
string deviceId := $activation.partition.toString();
log "Processing for partition: " + deviceId at INFO;
req.execute(HTTPHandler(deviceId, $parameters.timeout.toFloat() / 1000.0, $parameters.host).handleResponse);
req.execute(HTTPHandler(deviceId, $parameters.host).handleResponse);
$base.profile(BlockBase.PROFILE_OUTPUT);
}

Expand Down