Giter Club home page Giter Club logo

Comments (8)

viralpraxis avatar viralpraxis commented on June 24, 2024 1

It seels like the probelm is hardcoded input

"The \"#{@input_key}\" input on \"#{@actor}\" is missing",

which should be replaced with @origin

from actor.

sunny avatar sunny commented on June 24, 2024

Oh indeed. Right now the options only make sense to inputs as they are checked on call.

I’d be tempted to raise an error on any option passed to output as they are not supported.

Or we could make sure they actually work, but that would mean doing the check on the value_result= method call instead, I guess?

from actor.

viralpraxis avatar viralpraxis commented on June 24, 2024

Or we could make sure they actually work, but that would mean doing the check on the value_result= method call instead, I guess?

I'd prefer to make it working, it seems to be quite useful

from actor.

sunny avatar sunny commented on June 24, 2024

Happy to accept a PR to make type: work for outputs 🙏🏻

Actually instead of on the #value_result= method call it would make more sense to do that at the end of the #call, when exiting the actor.

from actor.

viralpraxis avatar viralpraxis commented on June 24, 2024

Hm, It seems like I misunderstood you.

The following actor

# frozen_string_literal: true

class AddGreetingWithDefault < Actor
  input :name, default: "world", type: String
  output :greeting, type: String

  def call
    self.greeting = 1
  end
end

works quite good, it throws

 ServiceActor::ArgumentError:
   The "greeting" output on "AddGreetingWithDefault" must be of type "String" but was "Integer"

from actor.

sunny avatar sunny commented on June 24, 2024

Yes! My bad, I’ve misunderstood the issue. I forgot that checks actually worked on outputs, I just never used them 🙈

I think the DefaultCheck doesn’t make much sense on outputs and should be probably be skipped in that case.

from actor.

viralpraxis avatar viralpraxis commented on June 24, 2024

Just to make sure I got you correctly, current behavior of

class WithUnsetOutput < Actor
  output :value, type: String, allow_nil: true
end

is

ServiceActor::ArgumentError:
The "value" input on "WithUnsetOutput" is missing

And if we skep default_check on outputs we'd expect it to complete successfuly with value == nil, right?

from actor.

sunny avatar sunny commented on June 24, 2024

Yeah, I think that would make sense.

from actor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.