|
If he's an urban leprechaun, you could use a metrognome.
Software Zen: delete this;
|
|
|
|
|
Your timing is off.
Mongo: Mongo only pawn... in game of life.
|
|
|
|
|
In my current multi threaded app I am using an AsyncSQLiteConnection and I need to make sure only one person at a single time use this connection. But with all the async code and background thread it's a bit difficult to track who does what!
Enter the ClassName .
I was thinking of a pun mixing Async + singleton = AsyncGleton .
Any other suggestion from you native speakers?
EDIT
Thanks TheGreateAndPowerfulOz, it is now Exclusive<T> , as in
async Task AsyncSave(Exclusive<ASyncSQLiteConnection> eConn) {
using (var session = eConn.AcquireValueAsync()) {
var conn = session.Value;
myData.ID = await conn.AsyncInsert<Table>(myData);
}
}
modified 15-Jun-16 18:46pm.
|
|
|
|
|
Yes. Never check any code into my repository.
I'm retired. There's a nap for that...
- Harvey
|
|
|
|
|
AsyncSQLiteSingleConnection
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
errr..... I was thinking along that line
class AsyncGleton<T> {}
AyncGleton<AsyncSQLiteConnection> database;
But your suggestion could be, then
class AsyncSingle<T> {}
yes?
nicer I think....
|
|
|
|
|
Well, AsycSingle<T> is better than AsyncGleton<T> but that still implies singleton-ness rather than one-at-a-time-ness. I assumed that you meant there could be more than one of the "T" instances, but any one of those could only be used by a single thread at a time. Does that mean one per thread or can it be shared between threads?
Also, if the Async-ness is not part of the wrapper class, but part of the "T" then why not Singly<T> or Exclusive<T> or Solo<T>. Of course, you can prefix Async to those if the Async-ness is part of the wrapper. Personally, I would choose Exclusive<T> or AsyncExclusive<T>.
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
There is only one of those T.. (since there is only 1 database file) but it might be shared across threads
I like your many suggestions.... Exclusive<T> it is!
Here you go, as sample method using it, using your suggested name!
async Task AsyncSave(Exclusive<ASyncSQLiteConnection> eConn) {
using (var session = eConn.AcquireValueAsync()) {
var conn = session.Value;
myData.ID = await conn.AsyncInsert<Table>(myData);
}
}
modified 15-Jun-16 17:43pm.
|
|
|
|
|
Lowe's Hires Man And His Service Dog, Outfits Them With Matching Vests[^]
He was being rejected other places due to his injury and service dog.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
/ravi
|
|
|
|
|
Can't buy publicity like that. Oh, wait...the Huffington Post probably did get paid for that ad.
|
|
|
|
|
Software Zen: delete this;
|
|
|
|
|
Could someone kindly explain to me how they got from "the box that makes a noise has something inside it" to "cats understand physics"?
Cats seem to grasp the laws of physics[^]
Sounds like a good way to swindle research funds.
|
|
|
|
|
Schrödinger's cat was a pioneer in the field; it seems it managed to make disciples.
Cats are quantic, obviously.
You always obtain more by being rather polite and armed than polite only.
|
|
|
|
|
I think what they are saying is the cat's understand that a box that rattles has something in it - so when that understanding fails they are surprised and stare longer. It's a bit of a stretch to get from that to "understanding physics" I agree, but the basic grasp of "noise == content" is established. And yes, cats do grasp some abstract concepts surprisingly well, and will experiment to get to a goal.
We had one that learned to raid his treats - which took jumping from the third step onto the wine rack, jumping from there to the top of the cabinet, leaning over the side to chew through the rubber band keeping the door shut (so he couldn't raid his treats), dropping to the shelf below so he could push himself up under the doors to get inside the cupboard. Took him about a week to work out - had to be the third step, the second was too low, the fourth too far away - and so on. But once he'd got it fixed, it took him seconds each time.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
OriginalGriff wrote: the basic grasp of "noise == content" is establishe I'd have said it's the basic grasp of "noise == something to chase".
Hunting instinct != understanding of Physics.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
My dog likes to chase photons on the floor.
|
|
|
|
|
So he understands about lasers, batteries, optics, etc.
That's good. You should write a paper about it.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
She's looking for a translator.
|
|
|
|
|
Great!
Sort one out, and let her do all the work!
You can just rake in all the money, because money has nothing to do with Physics, so cats don't understand it.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
This comes from people who think animal are stupid.
So they have to make grand theory to admit they were wrong.
The gist is, the cat shake the box and can detect whether there is something lose and moving inside by how the box make noise / behave differently from a solid object.
But they name it with the much more pompous name of "cats understand the law of physics"
Common guys, cats are predator, of course they know all about hiding!
|
|
|
|
|
Super Lloyd wrote: cats are predator, of course they know all about hiding!
Ours doesn't!
It's normally fairly obvious where he is hiding, because he forgets to cover his tail...
Mind you, it doesn't seem to hurt him as a hunter, he brings home dead-or-alive prey pretty much every day.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Haha, just like kids!
|
|
|
|
|
Your kids bring home rats, mice, moles, and dead birds?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Err... I was referring the visible tail when they hide...
Young kids usually only hide their face when they are hiding!
Or were you taunting me?! haha!
|
|
|
|