Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calling UNIX command hungs widget




On Aug 25, 2006, at 12:17 PM, Michael Kwasnicki wrote:

Thanks.
That workaround works.
But in the Dashboard Reference revision 2006-05-23 the synchronous execution is still available.

We recommend that you always review the latest and greatest documentation, available at developer.apple.com:

Am 25.08.2006 um 16:36 schrieb Johnny Storm:

It hung because you are using synchronous calls not asynchronous, Apple doesn't allow synchronous calls in widgets anymore
Obviously it should work the synchronous way, but it doesn't.

So what Johnny said is not exactly true.  Synchronous widget.system is still allowed but is strongly discouraged for shipping widgets.  You happen to be running into an issue with synchronous widget.system that should otherwise be working just fine.

I've attached a testWidget so everyone can try for himself.
It has the synchronous and the asynchronous methods included.
test1 reads a 1kb file synchrounous.
test50 reads a 50kb file synchronous but it fails. "cat" hungs and it's task has to be killed manually.
workaround1 and workaround50 do it the asynchronous way.

Thanks for the handy test case!  Could you please file a bug over at <http://bugreport.apple.com/> with this attached to it so that we can track the issue?

I'd like to prefer the synchronous execution where it is possible and the asynchronous where it is needed.
Writing a function that uses such a synchronous way is much easier to write.
Making it asynchronous only messes up the code.

This may be true, but there are techniques for keeping your code visually clean (e.g. inline functions, etc.).

Given future directions for Dashboard, we strongly recommend that you use widget.system asynchronously in shipping widgets from here on out.

Thanks!

Christian.


-- 

Christian Wagner

Writer — Apple TechPubs

email@hidden



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Dashboard-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/dashboard-dev/email@hidden

This email sent to email@hidden

References: 
 >Calling UNIX command hungs widget (From: Michael Kwasnicki <email@hidden>)
 >Re: Calling UNIX command hungs widget (From: Michael Kwasnicki <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.