The reason for the blocking is the usage of Semaphore. Perhaps a better implementation would be:
fetch: url
"
SstHttpClient fetch: 'http://time.gov/timezone.cgi?UTC/s/0'
"
|workBlock response sem|
workBlock := [
response :=
[
|client|
(client := SstHttpClient forTransportScheme: 'httpl') startUp.
[ response := client get: url ]
ensure: [
client shutDown.
sem signal
]
]
when: ExError
do: [ :sig | sig exitWith: nil ].
].
sem := AbtSemaphore new.
Processor activeProcess == UIProcess currentUI
ifTrue: [
workBlock
forkAt: Processor userSchedulingPriority
named: ('%1 [%2]' bindWith: self name with: Time now printString).
sem wait.
]
ifFalse: [workBlock value].
^response
--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
[hidden email].
To post to this group, send email to
[hidden email].
Visit this group at
http://groups.google.com/group/va-smalltalk?hl=en.
For more options, visit
https://groups.google.com/groups/opt_out.