<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Oct 28, 2013 at 5:53 PM, Corinne Krych <span dir="ltr">&lt;<a href="mailto:corinnekrych@gmail.com" target="_blank">corinnekrych@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I think Matthias point is interesting, bringing up AEROGEAR-918 JIRA.<br>
Shouldn&#39;t we align API changes to reflect the asynchronous option on Store for all client platforms?<br></blockquote><div><br></div><div>yeah, I agree!</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
++<br>
<span class="HOEnZb"><font color="#888888">Corinne<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Oct 28, 2013, at 3:38 PM, Lucas Holmquist &lt;<a href="mailto:lholmqui@redhat.com">lholmqui@redhat.com</a>&gt; wrote:<br>
<br>
&gt;<br>
&gt; On Oct 28, 2013, at 10:36 AM, Kris Borchers &lt;<a href="mailto:kris@redhat.com">kris@redhat.com</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Oct 28, 2013, at 9:33 AM, Matthias Wessendorf &lt;<a href="mailto:matzew@apache.org">matzew@apache.org</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On Mon, Oct 28, 2013 at 3:29 PM, Lucas Holmquist &lt;<a href="mailto:lholmqui@redhat.com">lholmqui@redhat.com</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On Oct 28, 2013, at 10:27 AM, Matthias Wessendorf &lt;<a href="mailto:matzew@apache.org">matzew@apache.org</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On Mon, Oct 28, 2013 at 2:10 PM, Lucas Holmquist &lt;<a href="mailto:lholmqui@redhat.com">lholmqui@redhat.com</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt; Hello Everybody,<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Now that we have support for IndexedDB and WebSQL in our Javascript library,  i&#39;ve started a fallback strategy for DataManager.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; There will need to be a bit of deprecation since the 2 new adapters are asynchronous and return a promise/callbacks and the other adapters are synchronous and return the actual data.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; We are thinking of adding an option,  &quot;aysnc&quot;, the name is up for debate,  which would only be valid for the memory and session/local adapters and would default to false and things would return as normal( this would also be removed in the next release and everything would be &quot;async&quot; ),  but if true, then these adapters would return like the 2 new adapters, using callbacks/promises.<br>

&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; could we make it async only ?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; it would be once we get to 1.4.0(?) since we need to deprecate<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; that&#39;s fine w/ me!<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Side note: I think we had _similar_ discussion in the past, and unfortunately ... we removed the async API ([1] from iOS).<br>
&gt;&gt;<br>
&gt;&gt; So the weird part here is that the localStorage and sessionStorage adapters will not be async. Even though they will return a promise, that promise will already be resolved because I/O on those operations is sync and we can&#39;t change that. So basically, these changes will make the API act async even though for those mentioned adapters, they will still technically be sync.<br>

&gt; Yes,  i think i missed that part.<br>
&gt;<br>
&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; [1] <a href="https://issues.jboss.org/browse/AEROGEAR-918" target="_blank">https://issues.jboss.org/browse/AEROGEAR-918</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Now on to the Fallback Strategy:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Here is a use case:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I&#39;m a user,  i create an IndexedDB store,  but the device/browser i&#39;m using doesn&#39;t support it.  I think there are 2 options we can go down here<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; 1. The user gets an error back about IndexedDB being not support,  just like regular. And they need to &quot;opt-in&quot; to the fallback stuff.  this would be an option on the &quot;add&quot; of the Store.  Maybe the actual Constructor?<br>

&gt;&gt;&gt;&gt; They would also be able to provide a list of adapters to try which would override our predefined list.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; 2. Fallback is assumed and there is no option,  it just happens, using our predefined list.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I think it would be nice if the fallback just happens; However, there might be the case that folks have a certain preference in actually specifying the option. Not sure.<br>
&gt;&gt;&gt;&gt; As of now I think I&#39;d support the #2<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; There is still the question of if the fallback is used,  and a &quot;Asynchronous&quot; store falls back to a &quot;Synchronous&quot; one,  what should be returned.  I&#39;m thinking what ever the return value of the &quot;Async&quot; one was.<br>

&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I don&#39;t see this as breaking API since the &quot;sync&quot; store was not meant to be created &quot;directly&quot;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; So if they create an IndexedDB store and it fallbacks to a memory adapter,  this store will use the &quot;async&quot; model<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; +1 makes sense<br>
&gt;&gt;&gt;&gt; See question above :-)<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Thoughts, comments, cat pictures,<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; -Luke<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt; aerogear-dev mailing list<br>
&gt;&gt;&gt;&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt; Matthias Wessendorf<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>
&gt;&gt;&gt;&gt; sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/mwessendorf</a><br>
&gt;&gt;&gt;&gt; twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a><br>
&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt; aerogear-dev mailing list<br>
&gt;&gt;&gt;&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; aerogear-dev mailing list<br>
&gt;&gt;&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; --<br>
&gt;&gt;&gt; Matthias Wessendorf<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>
&gt;&gt;&gt; sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/mwessendorf</a><br>
&gt;&gt;&gt; twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a><br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; aerogear-dev mailing list<br>
&gt;&gt;&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; aerogear-dev mailing list<br>
&gt;&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; aerogear-dev mailing list<br>
&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
<br>
<br>
_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Matthias Wessendorf <br><br>blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>
sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/mwessendorf</a><br>twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a>
</div></div>