RFC: mysql-native - Supporting both Vibe.d and Phobos sockets

Nick Sabalausky SeeWebsiteToContactMe at semitwist.com
Thu May 16 18:15:18 PDT 2013


On Thu, 16 May 2013 18:50:57 -0400
Nick Sabalausky <SeeWebsiteToContactMe at semitwist.com> wrote:
> 
> Hmm, there is a problem: For Vibe.d, mysql-native's Connection class
> is expected to derive from EventedObject. But EventedObject is part of
> Vibe.d. I'm not sure offhand how to handle that without making
> mysql-native's Connection templated.
> 

Actually, I think I figured out how to handle it:

There's no reason Connection's base type can't *always* be
EventedObject *WHEN* Vibe.d is actually available, regardless of
whether the user chooses to use Vibe's sockets or Phobos sockets. The
*only* time Connection actually *needs* to not use EventedObject is
when the user specifies -version=MySQLN_NoVibeD to disable mysqln's
static dependency on Vibe.d (a feature I was planning to add anyway).

So I just statically choose to inherit from EventedObject or plain-old
Object depending on whether MySQLN_NoVibeD exists, and that should work
fine.

Sorry for the noise!



More information about the Digitalmars-d mailing list