Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Based on my tests you have to wrap the insert in code I tested that is similar to the above example.</p> <p>For example, I did this and it still failed with Fibers error.</p> <pre><code>function insertPost(args) { if(args) { Fiber(function() { post_text = args.text.slice(0,140); T.post('statuses/update', { status: post_text }, function(err, reply) { if(reply){ // TODO remove console output console.log('reply: ' + JSON.stringify(reply,0,4)); console.log('incoming twitter string: ' + reply.id_str); // TODO insert record var ts = Date.now(); id = Posts.insert({ post: post_text, twitter_id_str: reply.id_str, created: ts }); }else { console.log('error: ' + JSON.stringify(err,0,4)); // TODO maybe store locally even though it failed on twitter // and run service in background to push them later? } } ); }).run(); } } </code></pre> <p>I did this and it ran fine with no errors.</p> <pre><code>function insertPost(args) { if(args) { post_text = args.text.slice(0,140); T.post('statuses/update', { status: post_text }, function(err, reply) { if(reply){ // TODO remove console output console.log('reply: ' + JSON.stringify(reply,0,4)); console.log('incoming twitter string: ' + reply.id_str); // TODO insert record var ts = Date.now(); Fiber(function() { id = Posts.insert({ post: post_text, twitter_id_str: reply.id_str, created: ts }); }).run(); }else { console.log('error: ' + JSON.stringify(err,0,4)); // TODO maybe store locally even though it failed on twitter // and run service in background to push them later? } } ); } } </code></pre> <p>I thought this might help others encountering this issue. I have not yet tested calling the asynchy type of external service after internal code and wrapping that in a Fiber. That might be worth testing as well. In my case I needed to know the remote action happened before I do my local action.</p> <p>Hope this contributes to this question thread.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload