-
Notifications
You must be signed in to change notification settings - Fork 0
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 #49 from ba-st/update_dependencies
Update dependencies
- Loading branch information
Showing
6 changed files
with
129 additions
and
117 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,8 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
exec /opt/pharo/pharo \ | ||
/opt/Superluminal-Service-Discovery-Example/Pharo.image \ | ||
super-luminal-service-discovery \ | ||
--message="${MESSAGE}" \ | ||
--consul-agent-location="${CONSUL_AGENT_LOCATION}" \ | ||
--retry-delay-in-ms=10000 | ||
/opt/app/Pharo.image \ | ||
launchpad start superluminal-service-discovery \ | ||
--retry-delay-in-ms=10000 |
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
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
81 changes: 81 additions & 0 deletions
81
source/Superluminal-Service-Discovery-Examples/SuperluminalServiceDiscoveryExample.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,81 @@ | ||
Class { | ||
#name : #SuperluminalServiceDiscoveryExample, | ||
#superclass : #LaunchpadApplication, | ||
#category : #'Superluminal-Service-Discovery-Examples' | ||
} | ||
|
||
{ #category : #accessing } | ||
SuperluminalServiceDiscoveryExample class >> commandName [ | ||
|
||
^ 'superluminal-service-discovery' | ||
] | ||
|
||
{ #category : #accessing } | ||
SuperluminalServiceDiscoveryExample class >> configurationParameters [ | ||
|
||
^ Array | ||
with: ( MandatoryConfigurationParameter named: 'Message' describedBy: 'Message to echo' ) | ||
with: ( MandatoryConfigurationParameter named: 'Consul Agent Location' | ||
describedBy: 'Location of the Consul agent' | ||
convertingWith: #asUrl ) | ||
with: ( OptionalConfigurationParameter named: 'Retry Delay in ms' | ||
describedBy: 'Milliseconds to wait between retries' | ||
defaultingTo: 200 milliSeconds | ||
convertingWith: [ :parameter | parameter asNumber milliSeconds ] ) | ||
] | ||
|
||
{ #category : #accessing } | ||
SuperluminalServiceDiscoveryExample class >> description [ | ||
|
||
^ 'I''m a command line example using as dependency an echo API' | ||
] | ||
|
||
{ #category : #accessing } | ||
SuperluminalServiceDiscoveryExample class >> version [ | ||
|
||
^ '3.0.0' | ||
] | ||
|
||
{ #category : #'private - activation' } | ||
SuperluminalServiceDiscoveryExample >> basicStartWithin: context [ | ||
|
||
| consulAgentLocation echoServiceLocation | | ||
|
||
consulAgentLocation := self configuration consulAgentLocation. | ||
LaunchpadLogRecord emitInfo: 'Discovering dependencies' during: [ | ||
echoServiceLocation := Retry | ||
value: [ | ||
( ConsulAgentHttpAPIBasedDiscoveryClient queryingAgentOn: | ||
consulAgentLocation ) withLocationOfService: #echo | ||
do: [ :location | location ] | ||
ifUnable: [ Error signal: 'Cannot discover #echo service' ] | ||
] | ||
configuredBy: [ :retry | | ||
retry | ||
upTo: 3 timesEvery: self configuration retryDelayInMs; | ||
on: Error evaluating: [ :attemptNumber :exception | | ||
LaunchpadLogRecord emitWarning: | ||
( 'Attempt #<1p> failed with error: <2s>' expandMacrosWith: | ||
attemptNumber | ||
with: exception messageText ) | ||
] | ||
] | ||
]. | ||
|
||
RESTfulAPIClient cachingOnLocalMemory | ||
get: ( echoServiceLocation | ||
scheme: #http; | ||
addPathSegment: 'echo'; | ||
addPathSegment: self configuration message; | ||
yourself ) | ||
withSuccessfulResponseDo: [ :response | | ||
response = self configuration message asUppercase ifFalse: [ Error signal: 'Invalid response received' ] ]. | ||
|
||
self exitSuccess | ||
] | ||
|
||
{ #category : #'error handling' } | ||
SuperluminalServiceDiscoveryExample >> stackTraceDumper [ | ||
|
||
^ NullStackTraceDumper new | ||
] |
82 changes: 0 additions & 82 deletions
82
...erluminal-Service-Discovery-Examples/SuperluminalServiceDiscoveryExampleLauncher.class.st
This file was deleted.
Oops, something went wrong.