I suggest to declare `self =>` at the begining of `MemoryQueue` and to replace all reference to `MemoryQueue.this` with `self`