Disposable is a ruby gem, which provides decorators on top of ORM layer.
Questions tagged [disposable]
61 questions
116
votes
3 answers
Setting an object to null vs Dispose()
I am fascinated by the way the CLR and GC works (I'm working on expanding my knowledge on this by reading CLR via C#, Jon Skeet's books/posts, and more).
Anyway, what is the difference between saying:
MyClass myclass = new MyClass();
myclass =…

GurdeepS
- 65,107
- 109
- 251
- 387
34
votes
11 answers
How to block Disposable Email Addresses in your website's registration form?
I would like to know of the possible ways to block disposable email addresses from registering in my website.
For simplicity, let's take the example where the registration form of the website is done with HTML and PHP.
Any ideas, solutions or…

CompilingCyborg
- 4,760
- 13
- 44
- 61
11
votes
2 answers
Disposable Resource Pattern
Is there anything standardized within the Scala library to support the disposable resource pattern?
I mean something similar to that supported by C# and .NET just to mention one.
For example does official Scala library provide something like…

Lord of the Goo
- 1,214
- 15
- 31
8
votes
6 answers
C# IDisposable question
I have the following code example:
public interface IRepository {
// Whatever
}
public class SampleRepository : IRepository {
// Implements 'Whatever'
}
public class NHibernateRepository : IRepository, IDisposable {
// ...
public…

Yippie-Ki-Yay
- 22,026
- 26
- 90
- 148
8
votes
2 answers
Will this be a valid base class for IDisposable
IDisposable pattern is expensive to implement. I've counted 17 lines of code before even starting to actually dispose resources.
Eric Lippert recently wrote a blog post bringing up an interesting point: any time a finalizer runs, it is a bug. I…

Xiaoguo Ge
- 2,177
- 20
- 26
8
votes
2 answers
Why should Dispose() dispose managed resources and finalizer not?
We all know the System.IDisposable pattern. It's been described a zillion time, also here on StackOverflow:
link: Dispose() for cleaning up managed resources?
The Disposable patterns advises that I should only dispose managed resources if my…

Harald Coppoolse
- 28,834
- 7
- 67
- 116
7
votes
1 answer
Swift Combine how Set works?
I have ViewModel with disposable Set defined this way
class ViewModel {
private var disposables = Set()
func sync() {
repo.syncObjects()
.handleEvents(receiveCancel: {
print("Synced objects:…

Michał Ziobro
- 10,759
- 11
- 88
- 143
7
votes
6 answers
C# disposable objects
Are there some advices about how I should deal with the IDisposable object sequences?
For example, I have a method that builds a IEnumerable sequence and
at some point I would need to dispose that objects manually, because…

Yippie-Ki-Yay
- 22,026
- 26
- 90
- 148
7
votes
3 answers
ServiceContainer, IoC, and disposable objects
I have a question, and I'm going to tag this subjective since that's what I think it evolves into, more of a discussion. I'm hoping for some good ideas or some thought-provokers. I apologize for the long-winded question but you need to know the…

Lasse V. Karlsen
- 380,855
- 102
- 628
- 825
5
votes
2 answers
How does IDisposable work with use and return?
In F# async workflows, we can define a resource that should be cleaned up with the use keyword.
But how does use interact with return?
For example, given this code:
let createResource = async {
use r = Resource ()
do! operationThatMightThrow…

sdgfsdh
- 33,689
- 26
- 132
- 245
4
votes
1 answer
How to send cancel signal to ConnectableFlowable?
I use disposable Flowable to emit and subscribe items. But when I try to use ConnectableFlowable I can not send cancel signal to emitter. How can I understand flowable is disposed inside Flowable.create method?
You can see the scenario by comment…

Gürcan Kavakçı
- 562
- 1
- 11
- 24
4
votes
6 answers
C# disposable question
Would the garbage collector automatically free the unmanaged resources (whatever, actually) associated with some IDisposable instance if, for example, I forgot to write using statement?
Obviously, I don't know when this would happen, but is it fine…

Yippie-Ki-Yay
- 22,026
- 26
- 90
- 148
4
votes
6 answers
Finalizers and Dispose
I've got a class named BackgroundWorker that has a thread constantly running. To turn this thread off, an instance variable named stop to needs to be true.
To make sure the thread is freed when the class is done being used, I've added IDisposable…

core
- 32,451
- 45
- 138
- 193
3
votes
2 answers
Managing disposable objects within static methods
public class SimpleLogger
{
static readonly string logFile = ConfigurationManager.AppSettings["LogFile"];
static StreamWriter GetStream()
{
return File.Exists(logFile) ?
File.AppendText(logFile) :…

fearofawhackplanet
- 52,166
- 53
- 160
- 253
3
votes
1 answer
Self-Disposable (inline) declaration for C# disposable variable
I can hardly believe the C# developers didnt thought about that. I dislike that there doesnt exist better way to create one-time disposable variables, as we have to declare them in blocks:
using( XYZ x = smth){
ShowForm(Color.Blue, x, "30px");
…

T.Todua
- 53,146
- 19
- 236
- 237