8kdata / phoebe

Toolkit for building asynchronous PostgreSQL drivers
PostgreSQL License
10 stars 7 forks source link

Improving code and functionality of the connection phase #2

Closed ahachete closed 8 years ago

ahachete commented 8 years ago

Created class Either<T,U> which hold either an instance of T or U. This class is now the basis for the Observable/Publisher return method of PostgresConnection.connections(). No longer successful and failed connections are mixed here in a single class, both are now separated class.

Code is now cleaner and type safer, while more readable. All in all, good win IMHO.

This was based on ianp's suggestion: https://groups.google.com/d/msg/phoebe/xsxZ-B1ctq4/C-kpH7hjDQAJ