-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #184 from ba-st/max_connections_configuration
Add a concurrent connections threshold configuration parameter
- Loading branch information
Showing
6 changed files
with
220 additions
and
44 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
source/Stargate-API-Skeleton-Tests/ConcurrentConnectionsTestApplication.class.st
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,40 @@ | ||
" | ||
I'm a testing application used to check the concurrent connections threshold configuration parameter behavior. | ||
" | ||
Class { | ||
#name : 'ConcurrentConnectionsTestApplication', | ||
#superclass : 'StargateApplication', | ||
#category : 'Stargate-API-Skeleton-Tests', | ||
#package : 'Stargate-API-Skeleton-Tests' | ||
} | ||
|
||
{ #category : 'accessing' } | ||
ConcurrentConnectionsTestApplication class >> commandName [ | ||
|
||
^ 'concurrent-connections-test' | ||
] | ||
|
||
{ #category : 'accessing' } | ||
ConcurrentConnectionsTestApplication class >> description [ | ||
|
||
^'A Test API making the request processing to wait a certain amount of time' | ||
] | ||
|
||
{ #category : 'initialization' } | ||
ConcurrentConnectionsTestApplication class >> initialize [ | ||
|
||
<ignoreForCoverage> | ||
self initializeVersion | ||
] | ||
|
||
{ #category : 'private' } | ||
ConcurrentConnectionsTestApplication class >> projectName [ | ||
|
||
^ 'Stargate' | ||
] | ||
|
||
{ #category : 'private - accessing' } | ||
ConcurrentConnectionsTestApplication >> controllersToInstall [ | ||
|
||
^ { DelayedRESTfulController new } | ||
] |
46 changes: 46 additions & 0 deletions
46
source/Stargate-API-Skeleton-Tests/DelayedRESTfulController.class.st
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,46 @@ | ||
" | ||
I'm a example of a RESTful controller: | ||
- only implementing GET operations | ||
- not paginating collections | ||
- not using hypermedia | ||
" | ||
Class { | ||
#name : 'DelayedRESTfulController', | ||
#superclass : 'SingleResourceRESTfulController', | ||
#instVars : [ | ||
'requestHandler' | ||
], | ||
#category : 'Stargate-API-Skeleton-Tests', | ||
#package : 'Stargate-API-Skeleton-Tests' | ||
} | ||
|
||
{ #category : 'routes' } | ||
DelayedRESTfulController >> declareWaitRoute [ | ||
|
||
^ RouteSpecification handling: #GET at: self endpoint evaluating: [ :httpRequest :requestContext | | ||
100 milliSeconds wait. | ||
ZnResponse ok: ( ZnEntity text: 'OK' ) | ||
] | ||
] | ||
|
||
{ #category : 'initialization' } | ||
DelayedRESTfulController >> initialize [ | ||
|
||
super initialize. | ||
requestHandler := RESTfulRequestHandlerBuilder new | ||
handling: 'wait'; | ||
createEntityTagHashingEncodedResource; | ||
build | ||
] | ||
|
||
{ #category : 'private' } | ||
DelayedRESTfulController >> requestHandler [ | ||
|
||
^ requestHandler | ||
] | ||
|
||
{ #category : 'private' } | ||
DelayedRESTfulController >> typeIdConstraint [ | ||
|
||
^ IsObject | ||
] |
13 changes: 7 additions & 6 deletions
13
source/Stargate-API-Skeleton-Tests/StargateApplicationStackTraceDumperTest.class.st
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
Oops, something went wrong.