Skip to content

Support context propagation on overloads #557

@nlachfr

Description

@nlachfr

Feature request checklist

  • There are no issues that match the desired change
  • The change is large enough it can't be addressed with a simple Pull Request
  • If this is a bug, please file a Bug Report.

Change

Currently, it is possible to use go contexts with the ContextEval(context.Context, interface{}) method. However, this context is not usable by function overloads.

Example

fn := &functions.ContextOverload{
    Operator: "longRunningOperation",
    Unary: func(ctx context.Context, value ref.Val) {
        if err := longRunningOperation(ctx, value.Value()); err != nil {
            return types.Bool(false)
        }
        return types.Bool(true)
    }
}

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