On 15/07/2013 04:04, Steven D'Aprano wrote:
On Mon, 15 Jul 2013 10:27:45 +0800, Gildor Oronar wrote:
A currency exchange thread updates exchange rate once a minute. If the
thread faield to update currency rate for 5 hours, it should inform
main() for a clean exit. This has to be done gracefully
Oh, I forgot another comment...
On Mon, 15 Jul 2013 03:04:14 +, Steven D'Aprano wrote:
> On Mon, 15 Jul 2013 10:27:45 +0800, Gildor Oronar wrote:
>>while time.time() - self.rate_timestamp < 5*3600:
>> ... # update exchange rate
>> if success:
>> self.
On Mon, 15 Jul 2013 10:27:45 +0800, Gildor Oronar wrote:
> A currency exchange thread updates exchange rate once a minute. If the
> thread faield to update currency rate for 5 hours, it should inform
> main() for a clean exit. This has to be done gracefully, because main()
> could be doing somethi
On Monday, July 15, 2013 10:27:45 AM UTC+8, Gildor Oronar wrote:
> What is the professional way in this case?
Hi. I am not a professional neither but I think a professional does this:
class CurrencyExchange():
def __init__(in_case_callback):
this.callback = in_case_callback
def __r