Not talking threads here, more Tokio tasks.
Not talking threads here, more Tokio tasks.
DUDE!
You are the man!
I did know it was built in rust but never realized I could also use it as a library!
🎉
It is now quite clear that I have to let go of OO paradigms. Maybe the package approach is perfectly fine.
Thank you for the insights and useful answer!
I have the idea that I am still only scratching the surface of rust, although I seem to manage it better every day.
As long as I leave my OO hat on the rack 😉
Well. I did read up on the “XY” problem and apparently you assume that what I want to do is somehow bad practice.
To elaborate more on the problem: I am writing an axum backend which (like other backends) needs to do stuff in the database. As some endpoints update the database (and sometimes over multiple sql statements) I want to pass around the transaction as this embodies the connection I am using to update the database.
To separate the axum stuff (parameters, urls and whatnot) from the actual database logic, I’ve first pulled out all the database interactions into separate functions. Because those functions are logically groups (e.g. stuff happening with invoices, others with contacts etc), I thought it was a good idea to create a “dao” struct (and agreed: my OO brain kicked in here which might be debatable). This would group the interactions for each logical domain into a short-lived data access struct.
To prevent passing around the transaction/connection, i wanted to pass that along during construction, so the functions in the DAO could just access the connection when needed.
Non “OO” would be fine to be honest (just having all the DAO as functions in a separate package).
Sorry, no code, not at the computer atm.
(And yes, I am aware that rust is not OO, put away the pitchforks please 🙏)
Seems like the into_inner is the way (i see other references to it).
And yes, transactions should be short-lived, this is just about delegating it to the responsible component.
So your answer is “you are doing it wrong”.
Thank you, very helpful 😉
I am currently using it from a backend to generate pdfs.
One thing that prevents me from letting users build their own templates is the scripting capabilities. A joker creating an endless loop could block the whole server.
What would be nice is a “safe” mode in which no access to the file system (include and sorts) and limited runtime makes it safe to let users build their own templates.
Don’t let the door hit you on the way out.
Amazing way to approach it!
Just a wee bit afraid there would be just porn left after applying the “subscribe to me” rule 😉
I was an avid nginx user but having caddy handle the ssl certificate creation and renewal is amazing.
I probably am outdated on nginx (maybe it supports it?) but caddy is what I use from here on out.
Quite possible. Old fogey here 😉
Bleeding edge in Debian? I was not even using the “testing” release of Debian.
If your point is that it’s fine for a company to get their stuff out there in a timely fashion, that company just sucks balls in my opinion.
Just FYI I am perfectly fine with you having your workarounds and (apparently different) opinion.
I expected some basic civility and more constructive tone of words. But if you start blaming me as a user for something basically ALL other vendors are coping with just fine, thats where the discussion stops with me.
I am definitely not against linux (daily user myself). And honestly, people like you don’t make Linux more attractive of an option.
Have a good one.
You have adapted your way of working around the fact that it can break:
I call that way of not updating “annoying” and insecure IMO.
Other vendors don’t have this issue.
My conclusion: steer clear of Nvidia.
Debian.
Well, every kernel update is overstated maybe, but I had my fixed workflow of dropping to text mode and reinstalling the latest drivers from vendor, which is annoying as hell.
Dropped the card after meddling about for almost a year. Been using Linux since slackware was still hip & happening.
I’ll interpret this as “it worked for you”. It did not work for me.
My experience with Nvidia (granted, 3 years old experience):
Going with the closed source driver means stuff breaking each kernel update. Going with the opensource driver (while it may work for you): not everything is supported.
So its not just “people being annoyed with Nvidia” i’d say.
I cant even watch it.
The pouting of the quivering lips on Trump is unbearable.
“Vladimir Putin says…”
Aaand my brain switches off. Another red line.
Thank you again and I will.