Comments (15)
Looks like its used in 3 places on master. Which was killing your performance?
https://github.com/amazonwebservices/aws-sdk-for-ruby/blob/master/lib/aws/sqs/queue.rb#L266
https://github.com/amazonwebservices/aws-sdk-for-ruby/blob/master/lib/aws/core/http/handler.rb#L69
https://github.com/amazonwebservices/aws-sdk-for-ruby/blob/master/lib/aws/core/client.rb#L241
from em_aws.
Also, why not use EM::Synchrony.sleep?
https://github.com/igrigorik/em-synchrony/blob/master/lib/em-synchrony.rb#L70
from em_aws.
Need some opinions on this patch...its pretty cooky but it will end the mutex and sleep issues:
require 'em-synchrony'
require 'em-synchrony/thread'
module AWS
# Use EM::Synchrony sleep
DupKernel = Kernel
class PatchKernel
class << self
def sleep(count)
EM::Synchrony.sleep(count)
end
def method_missing(method,*args,&block)
DupKernel.send(method, *args, &block)
end
end
end
Kernel = PatchKernel
# Use a fiber safe mutex
Mutex = EM::Synchrony::Thread::Mutex
end
from em_aws.
Try 0.1.5, it should resolve this issue.
from em_aws.
Have you guys seen any warnings when you re-set the constants? i.e.
Kernel = PatchKernel
A suggestion is to use Object.remove_const(:Kernel)
right before so that there'd be no Ruby warning. Not that it's functionally any different of course :)
from em_aws.
Yeah....this was not one of my better moments, but what patch really is ;) Let me see what I can do to pretty that up.
from em_aws.
Strangely though, I do not get the overriding constant warning in MRI 1.9.2.
from em_aws.
@jkchow can you give master a try?
Thanks
from em_aws.
Looks good on my end. By the way, great job w/ the gem overall!
from em_aws.
By the way, I don't get the overriding constant error either when I try requiring the older version in IRB. shrugs oh wells
from em_aws.
After some thought, this patch might be too heavy. For one, there could be that rare edge case where users may actually want to Kernel.sleep
or normal mutex (say they're using a script that first calls AWS via EM, then call EM.stop
, then later on call Kernel.sleep
.
I'd recommend in the #sleep
and Mutex
we do a check if EM is running and then delegate appropriately. What do you think?
EDIT : I saw the last commit just now, disregard this comment -.-
from em_aws.
@jkchow thanks, and if the last commit works for you I'll release a new version
from em_aws.
Ran a simple integration test on my project, looks good. Release that ish!
from em_aws.
Its out there.
from em_aws.
Should be resolved with latest releases.
from em_aws.
Related Issues (16)
- ThreadError: deadlock; recursive locking HOT 9
- Non-threadsafe libraries and EventMachine HOT 7
- Crash when using Sinatra's stream method. HOT 13
- log writing failed. undefined method `lock' for #<EventMachine::Synchrony::Thread::Mutex:0x00000004285038>
- Connection Pooling HOT 4
- S3 params are being ignored
- CRC32 integrity check failed with DynamoDB HOT 11
- HTTP Handler does not respect port settings HOT 1
- S3Object#exists? fails when no object HOT 4
- HTTP Handler does not respect request.read_timeout HOT 8
- AWS-SDK 1.9.0 Breaks EmAws HOT 3
- Callback sample HOT 2
- Support for ruby 2.0.0 HOT 1
- Getting DynamoDB responses with status 0 for requests that work with the default net_http_handler HOT 14
- Method to determine when an async request has finished HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from em_aws.