Fix default port, align with asyncio_redis, fix pool

* Pool had broken methods that didn't make sense, so deleted
* Fix port to be right mongodb default port
* Change pool_size to poolsize to align with asyncio_redis
* Write logs to own logger
This commit is contained in:
Don Brown
2014-02-16 01:33:39 -07:00
parent 416c181415
commit 06bdf73134
4 changed files with 20 additions and 22 deletions

View File

@@ -1,8 +1,8 @@
import logging
from asyncio_mongo.log import logger
from asyncio_mongo.database import Database
from .protocol import MongoProtocol
from asyncio.log import logger
import asyncio
import logging
__all__ = ['Connection']
@@ -24,7 +24,7 @@ class Connection:
@classmethod
@asyncio.coroutine
def create(cls, host='localhost', port=6379, loop=None, password=None, db=0, auto_reconnect=True):
def create(cls, host='localhost', port=27017, loop=None, auto_reconnect=True):
connection = cls()
connection.host = host
@@ -33,7 +33,7 @@ class Connection:
connection._retry_interval = .5
# Create protocol instance
protocol_factory = type('MongoProtocol', (cls.protocol,), { 'password': password, 'db': db })
protocol_factory = type('MongoProtocol', (cls.protocol,), {})
if auto_reconnect:
class protocol_factory(protocol_factory):