Skip to content

Cleanup behavior #64

Description

@elbaro

If the asyncio.Future returned by this conversion is cancelled via asyncio.Future.cancel, the Rust future will be cancelled as well (new behaviour in v0.15).

When a Python future is garbage collected without completion or cancellation, will the corresponding Rust future from tokio::spawn keep running?

How about wrapping the python future in something like this?

class FutureWrap:
   ...
   def __del__(self):
      if (not done) and (not cancelled):
         cancel_signal.send()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions