**** BEGIN LOGGING AT Mon Jan 19 02:59:58 2015 Jan 19 19:30:14 Hey, I have a question about PalmBus (ls2, PalmServiceBus) requests and Enyo: who’s responsible for keeping a reference around until the request completes? Jan 19 19:30:56 what do you mean by keeping a reference around? Jan 19 19:31:39 At the lowest JS layer, window.PalmServiceBus is called to produce an object per call. Jan 19 19:32:21 If no reference is kept to the per-request obejct, it is subject to garbage collection. Jan 19 19:33:44 For one-shot requests, garbage collection is unlikely before the call completes in a few seconds. (but could happen in a low-memory situation) Jan 19 19:34:39 It’s much more an issue for subscriptions that might be around indefinitely. Jan 19 19:35:21 then wouldn't it be your job to keep the reference? Jan 19 19:36:24 The question is whether ServiceRequest (there are similar but different iplementations in enyo-webos and webos-lib) should keep a reference, or the application code. Jan 19 19:36:51 for subscriptions, the app side should definitely be keeping a reference Jan 19 19:37:19 That seems reasoanble… gotta go AFK Jan 19 19:38:19 Mojo/Enyo devs for webOS apps have always been advised to do that Jan 19 20:53:48 My concern is for one-shot requests. It’s easy to store the request as a local variable in some function. Even after the call completes, it’s unlikely that the local variables will be garbage-collected in the few seconds before a typical call returns. However, in a low-memory situation the local variable might be garbage-collected, cancelling the request. Jan 19 20:55:05 So, requiring the app to keep a reference encourages a coding style which is prone to hard-to-reproduce bugs in low memory situations. Jan 19 22:21:57 I suppose the key point is that whichever object creates a request must maintain a reference. So. PalmService should maintain a reference to ServiceRequest objects, and the docs for ServiceRequest should not the necessity of maintaining a reference. Jan 19 22:22:28 s/not the necessity/note the necessity/ **** ENDING LOGGING AT Tue Jan 20 02:59:59 2015