Skip to content

Releases: i2y/pyffi

Release list

v0.6.0

Choose a tag to compare

@i2y i2y released this 06 Apr 00:30

New Features

  • CallContext / CallKwContext on *Object and *BoundModule — context-aware variants of Call / CallKw that respect context.Context cancellation and deadlines. If the context is cancelled before the Python call completes, the Go caller returns ctx.Err() immediately while the background goroutine cleans up automatically.

Example

ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()

result, err := fn.CallContext(ctx, arg1, arg2)
if errors.Is(err, context.DeadlineExceeded) {
    // Python call took too long
}

Internal

  • Extracted Runtime.callKw internal helper to share logic between CallKw and CallKwContext.