Skip to content

Commit

Permalink
Prepare 0.10.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Neil Booth committed Feb 16, 2019
1 parent 85461ed commit 2c1cb74
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion aiorpcx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from .util import *


_version_str = '0.10.4'
_version_str = '0.10.5'
_version = tuple(int(part) for part in _version_str.split('.'))


Expand Down
2 changes: 1 addition & 1 deletion aiorpcx/framing.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from hashlib import sha256 as _sha256
from struct import Struct

from aiorpcx import Queue
from .curio import Queue


class FramerBase(object):
Expand Down
1 change: 0 additions & 1 deletion aiorpcx/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import asyncio
import logging
import time
from contextlib import suppress

from aiorpcx.curio import (
Event, TaskGroup, TaskTimeout, CancelledError,
Expand Down
11 changes: 6 additions & 5 deletions aiorpcx/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,23 +85,24 @@ def signature_info(func):
return SignatureInfo(min_args, max_args, required_names, other_names)


def _require_non_negative(self, value):
if not isinstance(value, int) or value < 0:
raise RuntimeError('concurrency must be a natural number')


class Concurrency(object):

def __init__(self, max_concurrent):
self._require_non_negative(max_concurrent)
self._max_concurrent = max_concurrent
self.semaphore = asyncio.Semaphore(max_concurrent)

def _require_non_negative(self, value):
if not isinstance(value, int) or value < 0:
raise RuntimeError('concurrency must be a natural number')

@property
def max_concurrent(self):
return self._max_concurrent

async def set_max_concurrent(self, value):
self._require_non_negative(value)
_require_non_negative(value)
diff = value - self._max_concurrent
self._max_concurrent = value
if diff >= 0:
Expand Down
6 changes: 6 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ ChangeLog
.. note:: The aiorpcX API changes regularly and is still unstable


Version 0.10.5 (16 Feb 2019)
----------------------------

* export 'normalize_corofunc'
* batches: fix handling of session loss; add test

Version 0.10.4 (07 Feb 2019)
----------------------------

Expand Down

0 comments on commit 2c1cb74

Please sign in to comment.