Although this commit introduces a race condition since an event may only be half-resolved. A lock is thus needed, but it depends on an event-loop to which we don't have access in the class-level.