Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Releases: patrick-kidger/tinyio

tinyio v0.4.0

Choose a tag to compare

@github-actions github-actions released this 14 Mar 11:19

This release has two breaking changes, and is otherwise characterized by a lot of hardening in cases of misbehaving coroutines.

Breaking changes

  • tinyio.as_completed is now used as:

    iterator = yield tinyio.as_completed({coro1, coro2, coro3})
    for next_coro in iterator:
     result = yield next_coro

    instead of manually polling .done in a while loop.

  • tinyio.from_trio is now used as tinyio.from_trio(coro) instead of tinyio.from_trio(fn, *args), which is now consistent with the rest of the tinyio API.

Bugfixes

  • If a coroutine does not respond properly to .throw (e.g. ignores it instead of shutting down) then this will no longer cause undefined behaviour of the loop (I have no idea what would have happened before), and a warning will be thrown.
  • The tinyio<>trio and tinyio<>asyncio integrations will now propagate exceptions raised on either side of the integration, shutting coroutines down appropriately.
  • If using the (advanced) tinyio.Loop().runtime API, then we now detect cases in which the loop is not ran to completion and throw an appropriate error.

Usability

  • Yielding an already-started generator will now raise an appropriate error.
  • Nicer tracebacks under various circumstances.

Features

  • Added tinyio.isolate(coro), which makes it possible to run a coroutine which may raise an error (or if any of its yielded coroutines raise an error). (Thanks @aburgm!)

    For the event loop geeks: this is basically equivalent to the existing tinyio<>{trio,asyncio} integrations, in which we have one event loop being a guest of another... except in this case it's one tinyio loop being a guest of another tinyio loop! The 'inner' loop becomes the boundary at which exceptions stop propagating, whilst the 'outer' loop handles the overall stepping of the system.

    For everyone else: this is an advanced feature you probably don't need to worry about :)

Documentation

  • Big documentation update, in particular describing how to set up async context managers and async iterators.

Full Changelog: v0.3.0...v0.4.0

Contributors

aburgm
Assets 2
Loading
patrick-kidger and aguaviva reacted with heart emoji
2 people reacted

tinyio v0.3.0

Choose a tag to compare

@github-actions github-actions released this 16 Jan 11:08

Critical bugfix (issue introduced in v0.2.1): coroutines are now cancelled is a KeyboardInterrupt occurs whilst the event loop is waiting. (Thanks @aburgm! #16,#17)

Full Changelog: v0.2.1...v0.3.0

Contributors

aburgm
Loading

tinyio v0.2.1

Choose a tag to compare

@github-actions github-actions released this 07 Jan 21:50
  • Feature: added tinyio.{to_asyncio, to_trio, from_asyncio, from_trio} for integrating with other event loops.
  • Bugfix: calling loop.run whilst it is already running will now correctly raise an error.
  • Bugfix: calling loop.run on an already-completed coroutine will no longer return None.

Full Changelog: v0.2.0...v0.2.1

Loading

tinyio v0.2.0

Choose a tag to compare

@github-actions github-actions released this 04 Aug 10:24

A couple of breaking changes to tidy up our interface:

  • Removed tinyio.add_done_callback. This was literally just out = yield coro; success_callback(out) so it's pretty trivial for a user to write as a wrapper coroutine themselves (and in the same number of function definitions, as they previously had to write the callback anyway).
  • Switched from iterator = tinyio.AsCompleted(...) to iterator = yield tinyio.as_completed(...). In particular these tasks are scheduled in the background at the moment of this new yield, rather than on the first get. This should make multi-consumer cases a bit more natural.

I think I'm pretty happy with what the API is now settling down to look like.

Full Changelog: v0.1.4...v0.2.0

Loading

tinyio v0.1.4

Choose a tag to compare

@github-actions github-actions released this 02 Aug 21:56
  • Performance: we now use a proper event-based system to notify when to wake up the event loop (rather than leaving it busy-polling). This is a fairly major rewrite of our internals! And correspondingly we are now only '300 lines'-tiny rather than '200 lines'-tiny.
  • Feature: tinyio.Event.wait now supports timeouts.
  • Feature: added tinyio.Event.clear to un-set an event.
  • QoL: added a guardrail to prevent yielding on an already-completed coroutine that the loop has not seen before.
  • QoL: added a guardail to prevent performing if event: instead of if event.is_set():
  • QoL: if multiple .run_in_threads all error out at the same time, then this is handled appropriately.

Full Changelog: v0.1.3...v0.1.4

Loading

tinyio v0.1.3

Choose a tag to compare

@github-actions github-actions released this 30 Jul 17:43

We now ship batteries-included with the usual collection of standard operations. No changes to the core event loop, these are all just the obvious implementations on top of it:

  • tinyio.add_done_callback
  • tinyio.AsCompleted
  • tinyio.Barrier
  • tinyio.Event
  • tinyio.Lock
  • tinyio.Semaphore
  • tinyio.ThreadPool
  • tinyio.timeout

Hopefully we can include these without invalidating the 'tiny' in our name! 😁

Full Changelog: v0.1.2...v0.1.3

Loading
altaic and lyxal reacted with heart emoji
2 people reacted

tinyio v0.1.2

Choose a tag to compare

@github-actions github-actions released this 29 Jul 15:03

What's Changed

New Contributors

Full Changelog: https://github.com/patrick-kidger/tinyio/commits/v0.1.2

Contributors

davidbrochart and patrick-kidger
Loading

AltStyle によって変換されたページ (->オリジナル) /