GithubHelp home page GithubHelp logo

Comments (13)

JoshMcKin avatar JoshMcKin commented on May 29, 2024

hmmm. Try calling your code from within EM.synchrony block:

EM.synchrony do
  # some EM-aws stuff.
    EM.stop
end

from em_aws.

JoshMcKin avatar JoshMcKin commented on May 29, 2024

I usually get that error when the em-http-request is not using em-synchony's version of em-http-request

from em_aws.

pwiebe avatar pwiebe commented on May 29, 2024

Thanks. Tried this, but still am getting the error. If I switch out em_http_handler then it works fine. But that defeats the purpose.

I'll keep digging... Thanks again for your quick responses.

Sent from my iPad...

On May 22, 2012, at 21:32, "Joshua T. Mckinney" [email protected] wrote:

hmmm. Try calling your code from within EM.synchrony block:

EM.synchrony do
# some EM-aws stuff.
end

Let me know if that helps.


Reply to this email directly or view it on GitHub:
#5 (comment)

from em_aws.

JoshMcKin avatar JoshMcKin commented on May 29, 2024

No problem. Whats the round trip request time, from start to fail. If it runs longer than your timeout set for EM in the app server (thin defaults to 30) you can sometimes get weird errors.

from em_aws.

JoshMcKin avatar JoshMcKin commented on May 29, 2024

Try 0.1.5, it should resolve this issue.

from em_aws.

pwiebe avatar pwiebe commented on May 29, 2024

Unfortunately, I still get the same thing happening.

Sent from my iPad

On Jun 16, 2012, at 13:03, "Joshua T. Mckinney" [email protected] wrote:

Try 0.1.5, it should resolve this issue.


Reply to this email directly or view it on GitHub:
#5 (comment)

from em_aws.

JoshMcKin avatar JoshMcKin commented on May 29, 2024

hmm, wonder if it an EM or Synchrony thing. Have you tried file streaming from another source using EM::Synchrony directly?

from em_aws.

JoshMcKin avatar JoshMcKin commented on May 29, 2024

Also, can you post an example of the code your using to stream the file.

Thanks

from em_aws.

pwiebe avatar pwiebe commented on May 29, 2024

This is the general flow of the code: 

post '/get_file' do
 ...
  obj = $S3Client.buckets['files'].objects[key]
          stream do |out|
            obj_stream(obj) { |d| out << d }
          end
...
end

private

def obj_stream(obj)
    if obj.exists? 
size = obj.content_length 
byte_offset = 0 
while byte_offset < size 
 range = "bytes=#{byte_offset}-#{byte_offset + CHUNK_SIZE - 1}" 
 yield obj.read(:range => range)
 byte_offset += CHUNK_SIZE 
end 
    end 
end


From: Joshua T. Mckinney [email protected]
To: Philip Wiebe [email protected]
Sent: Tuesday, June 19, 2012 11:29 AM
Subject: Re: [em_aws] Crash when using Sinatra's stream method. (#5)

Also, can  you post an example of the code your using to stream the file.

Thanks


Reply to this email directly or view it on GitHub:
#5 (comment)

from em_aws.

pwiebe avatar pwiebe commented on May 29, 2024

I have not tried any other form of streaming.

It seems that the 'yield' is getting interpreted at the wrong level?  Its strange.


From: Joshua T. Mckinney [email protected]
To: Philip Wiebe [email protected]
Sent: Tuesday, June 19, 2012 11:28 AM
Subject: Re: [em_aws] Crash when using Sinatra's stream method. (#5)

hmm, wonder if it an EM or Synchrony thing. Have you tried file streaming from another source using EM::Synchrony directly?


Reply to this email directly or view it on GitHub:
#5 (comment)

from em_aws.

JoshMcKin avatar JoshMcKin commented on May 29, 2024

Ahhh. At this time the handler returns the body of the em-http-request, without streaming. We can look into adding a streaming option, not sure if is even possible but am willing to try when I get some free time.
Ref:
https://github.com/amazonwebservices/aws-sdk-for-ruby/blob/41dc5f953af70320c121db416964dab4e5c36166/lib/aws/s3/request.rb#L72
https://github.com/igrigorik/em-http-request/wiki/Streaming

from em_aws.

JoshMcKin avatar JoshMcKin commented on May 29, 2024

@pwiebe if you have time can you please test the stream branch. I have no experience with streaming but going by em-http-request docs and the sdk's net_http_handler i think I should be close.

from em_aws.

pwiebe avatar pwiebe commented on May 29, 2024

Sorry, I've been quite busy lately. I'll get to it this week and let you know.

Sent from my iPhone

On Jan 2, 2013, at 21:03, "Joshua T. Mckinney" [email protected] wrote:

@pwiebe if you have time can you please test the stream branch. I have no experience with streaming but going by em-http-request docs and the sdk's net_http_handler i think I should be close.


Reply to this email directly or view it on GitHub.

from em_aws.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.