similar to: Singleton pattern

Displaying 20 results from an estimated 1000 matches similar to: "Singleton pattern"

2006 Oct 16
4
Singleton Pattern in RoR
Hi all how can I implement the singleton patter in RoR? thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this
2006 May 22
2
using Singleton with Prototype
Hello all. I''m writing my own object using prototype and I wonder how you write and call only one instance of class. Can anyone share his idea of singleton? thanks Gregor ---------------------------------------------------- Gdy nadchodzi przełomowy moment w historii, musisz zdecydować, po czyjej stronie będziesz. "X-Men: Ostatni bastion" - w kinach od 26 maja.
2009 Oct 08
4
[LLVMdev] Is ExecutionEngine always meant to be a singleton?
Right now, on X86, creating multiple ExecutionEngines in the same process causes an assertion. If it's supposed to always be a singleton, should there be a way to get the process's ExecutionEngine instance? This would, among other things, allow "lli" to execute bitcode that itself uses the ExecutionEngine.
2009 Oct 09
0
[LLVMdev] Is ExecutionEngine always meant to be a singleton?
On Oct 8, 2009, at 9:19 AM, Kenneth Uildriks wrote: > Right now, on X86, creating multiple ExecutionEngines in the same > process causes an assertion. > Yes. This is by design. > If it's supposed to always be a singleton, should there be a way to > get the process's ExecutionEngine instance? > I can't see why. You could make a server to process llvm code. >
2006 Aug 23
5
Singleton-like Worker
Hello there, I need a Worker Class to be Singleton-like, that means there must be at maximum one Instance at a time. When a new Request is made to create another worker of this type, it should return and wait for the other instance to be destroyed. what i need to do: i have a worker who needs to do sth with java and openoffice, and it seems when i have more tha one worker simultaneously,
2007 Mar 13
1
Opening the singleton class of mocked objects
I wrote a plugin [1] a while ago that lets me do validations on a single AR instance. Instead of defining validations in an AR class, I can define them on a AR instance''s singleton class: class << @video validates_presence_of :title end One of my specs mocks Video.find, and the above code is run on the mock object. When I run the spec, I get the expected undefined method
2008 May 07
2
Can I add a singleton action to @controller in a test?
All, I want to create a mock action to test a filter in a functional test, e.g.: # Simplified example def test_my_filter # Singleton action def @controller.foo assert # something end ActionController::Routing::Routes.draw do |map| map.connect '':controller/foo'', :action => ''foo'' end get :foo end My log files show that
2008 Oct 05
5
asterisk, phpagi and singleton
Hello, I've this situation: 300+ simultaneous calls and dialplan like this: exten => _X.,1,Answer() exten => _X.,2,DEADAGI(check_status.php) exten => _X.,3,Dial(SIP/other/${NUMBER}) exten => _X.,4,Hangup exten => h,1,DEADAGI(cdr.php) When project is running , I had a lot of defunct php scripts (I've exceed mysql connection limits and so on, deadagi help a bit). The
2012 Jan 24
1
debug package: mtrace fails
Hi all, Since three month ago I started working with R professionally, I never did it before, so I am such a newbie. I am having some problems using the 'debug' package. I love this package, but most of the times I wanna use it it just fails :P When typing at prompt 'mtrace(myfunct)' most of the times I get the following error: "Error in x[[i]] : subscript out of
2010 Feb 04
2
[LLVMdev] Jit singleton
Hi everyone ! If I call ExecutionEngine::createJIT (or EngineBuilder::create) more than one time, the second time fails on a assertion "Multiple JIT resolvers?". It seems that the JIT is designed to be a singleton in the process, and I was wondering if it was something mandatory. How hard will it be to make it a non-singleton object ? Is this a JIT-only problem (work needed on JIT
2008 Dec 05
3
"singleton can't be dumped," but not using singleton
An action handler (select_person_by_name) in my controller class assigns into session, and then does a redirect_to. I get the error "TypeError (singleton can''t be dumped):" followed by a stack trace that doesn''t cross my code. Google tells me this is ordinarily caused by assigning a singleton instance into session, but what I''m assigning is an ordinary String.
2010 Feb 07
3
[LLVMdev] Jit singleton
Hi Jeffrey, Thanks for pointing me in the right direction ! I'm not using the JIT in lazy mode, but it was fun to understand the lazy-stub code. Attached you will find a patch which follow your 1st option : a map Stub_address -> JITResolver instance, except that the used map is a "std::map" to apply the same upper_bound trick as in the map CallSiteToFunctionMap of the
2010 Feb 04
0
[LLVMdev] Jit singleton
In eager compilation mode, I don't know of anything that would go wrong with having multiple JITs in the process. However, in lazy compilation mode, we need to map stub addresses to the JIT that knows how to compile them. Right now, that's done by looking up the static "TheJITResolver" variable and assuming it's the only JIT, but we could 1) use a static
2010 Feb 10
0
[LLVMdev] Jit singleton
Thanks for the patch! I'll clean this up, convert your sample to a unit test, and commit it for 2.7. On Sun, Feb 7, 2010 at 6:09 AM, Olivier Meurant <meurant.olivier at gmail.com> wrote: > Hi Jeffrey, > > Thanks for pointing me in the right direction ! > I'm not using the JIT in lazy mode, but it was fun to understand the > lazy-stub code. > > Attached you will
2010 Feb 10
1
[LLVMdev] Jit singleton
Thanks Jeffrey ! If possible, keep me inform (on revision number), I'm interested to see how you will do the unit test. (For my future patch... :) ). Thanks again. Olivier. On Wed, Feb 10, 2010 at 6:22 PM, Jeffrey Yasskin <jyasskin at google.com>wrote: > Thanks for the patch! I'll clean this up, convert your sample to a > unit test, and commit it for 2.7. > > On Sun,
2007 Aug 21
7
mocking singletons
How can I safely mock a singleton without the mocked method living on outside the scope of the test method? I''ve run into this problem with mocking methods on globals (gasp!) in the past by doing something like def mock_my_global original = $my_global $my_global.expects(:foo).returns(''bar'') yield $my_global = original end Is there something similar I
2006 Jul 03
6
Req: Workers as singletons
Hi, it would be nice to be able to specify workers as singletons. By this I mean that every call to the new_worker method returns the same instance of said worker. This can be done transparently either by adding a new argument to new_worker (something like :singleton => true) or adding a new method, like I did in my installation of BackgrounDrb: def get_worker_by_class(klass)
2006 Jul 25
3
Question about how Mongrel process works with singletons
Hi, I have a controller where I access a singleton class that I use to connect to a DRbprocess DrbConnector.instance.some_method I notice that on every request, the constructor is called so it is making a new instance of this singleton. Is this normal? Thanks, Curtis
2005 Mar 30
2
Beginner question: serverside singletons?
Hello all, just started tinkering with Rails after reading all the hype about it. I''m a raw novice with Ruby and (obviously) Rails, but have extensive experience with serverside Java (J2EE stack, Tapestry, etc). Rails looks cool, though embedding Ruby code in HTML reminds me unpleasantly of JSP + Struts and I''m deeply suspicious of all the behind-the-scenes magic going on in
2009 Feb 04
4
Rails 2.2.2 to_date and to_datetime methods
In the console I see this behaviour: >> "19270412000000".to_date.methods => ["ns?", "mon", "ago", "end_of_month", "months_since", "default_inspect", "minus_without_duration", ... >> "19270412000000".to_date.class => Date >> "19270412000000".class => String >>