Skip to content

Commit 67db749

Browse files
Merge pull request #145 from snowplow/release/0.8.0
Release/0.8.0
2 parents 5ffab25 + 3b845fe commit 67db749

File tree

4 files changed

+43
-3
lines changed

4 files changed

+43
-3
lines changed

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Version 0.8.0 (2024-12-12)
2+
--------------------------
3+
Add setCurlAmount and setRollingWindow setters to CurlEmitter
4+
15
Version 0.7.1 (2024-05-15)
26
--------------------------
37
Log the file name in errors from emitter (#143) thanks to @kaurov

src/Constants.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Constants {
4545
* - SSL: the default for whether or not to use SSL Encryption
4646
* - Type: the default for what type of request the emitter will be making (POST or GET)
4747
*/
48-
const TRACKER_VERSION = "php-0.7.1";
48+
const TRACKER_VERSION = "php-0.8.0";
4949
const DEFAULT_BASE_64 = true;
5050
const DEBUG_LOG_FILES = true;
5151
const CONTEXT_SCHEMA = "iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-1";

src/Emitters/CurlEmitter.php

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,16 @@ public function returnCurlBuffer() {
304304
}
305305

306306
/**
307-
* Returns the amount of curls we need before sending
307+
* Set the amount of times we need to reach the buffer limit (buffer_size) before we initiate sending
308+
*
309+
* @param int $curl_limit
310+
*/
311+
public function setCurlAmount($curl_limit) {
312+
$this->curl_limit = $curl_limit;
313+
}
314+
315+
/**
316+
* Returns the amount of times we need to reach the buffer limit (buffer_size) before we initiate sending
308317
*
309318
* @return int
310319
*/
@@ -313,7 +322,16 @@ public function returnCurlAmount() {
313322
}
314323

315324
/**
316-
* Returns the amount of simultaneous curls we send
325+
* Set the max amount of concurrent curl requests being made
326+
*
327+
* @param int $rolling_window
328+
*/
329+
public function setRollingWindow($rolling_window) {
330+
$this->rolling_window = $rolling_window;
331+
}
332+
333+
/**
334+
* Returns the max amount of concurrent curl requests being made
317335
*
318336
* @return int
319337
*/

tests/tests/EmitterTests/CurlEmitterTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,22 @@ public function testReturnFunctions() {
140140
$this->assertEquals(10,
141141
$emitter->returnRollingWindow());
142142
}
143+
144+
public function testSetRollingWindow() {
145+
$tracker = $this->returnTracker("POST", false, $this->uri);
146+
$emitters = $tracker->returnEmitters();
147+
$emitter = $emitters[0];
148+
149+
$emitter->setRollingWindow(32);
150+
$this->assertEquals(32, $emitter->returnRollingWindow());
151+
}
152+
153+
public function testSetCurlAmount() {
154+
$tracker = $this->returnTracker("POST", false, $this->uri);
155+
$emitters = $tracker->returnEmitters();
156+
$emitter = $emitters[0];
157+
158+
$emitter->setCurlAmount(12);
159+
$this->assertEquals(12, $emitter->returnCurlAmount());
160+
}
143161
}

0 commit comments

Comments
 (0)