Code Monkey home page Code Monkey logo

Comments (5)

csantanapr avatar csantanapr commented on June 9, 2024 1

@jthomas

In the code above, this won't be the default behaviour. It relies on the user explictly setting a function parameter, which defaults to false. This mirrors the behaviour of the JavaScript SDK.

Sorry read your comment again, I think I missed it the first time.

The default behavior for what ever reason today (ie. 3.1.1) _Whisk class API is blocking: Bool = true different from the JavaScript SDK.
https://github.com/apache/incubator-openwhisk-runtime-swift/blob/master/core/swift3.1.1Action/spm-build/_Whisk.swift#L23

 class func invoke(actionNamed action : String, withParameters params : [String:Any], blocking: Bool = true) -> [String:Any] {

It would be good to have consistency with theJavaScript SDK, but I think is more important to not break people's code by changing the API when they move from swift 3 to swift4.

I think it's something to note when we get to building new Library/SDK for swift4+ both client and server, and maybe a new Class OpenWhisk, then I think will have an opportunity to change the API to invoke

from openwhisk-runtime-swift.

csantanapr avatar csantanapr commented on June 9, 2024

Thanks for opening this.
I thought I already opened an issue to document my findings.

For swift 4 we plan to use urlSession.
Ignoring SSL is not a good thing, so the library should not be supporting this.

I made the SDK to allow to take an override to APIHOST, by allowing the user to specify a baseURL.
In this baseURL user can specify the Whisk API using http instead of https

This allowed me to write test to pass in Travis.

I production system WHISK APIHOST will always be https with valid certificates.
I opened issue #11 and will plan to work on it.

We can leave this issue open until linux supports self sign certs, and then allow an override in the Class to skip ssl checks, but should not be the default.

from openwhisk-runtime-swift.

csantanapr avatar csantanapr commented on June 9, 2024

Here is an example

 //Overriding WHISK API HOST using baseUrl, only applicable in testing with self sign ssl certs"
 Whisk.baseUrl = "http://172.17.0.1:10001"
 let invokeResult = Whisk.invoke(actionNamed: "/whisk.system/utils/date", withParameters: [:], blocking: false)

from openwhisk-runtime-swift.

jthomas avatar jthomas commented on June 9, 2024

In the code above, this won't be the default behaviour. It relies on the user explictly setting a function parameter, which defaults to false. This mirrors the behaviour of the JavaScript SDK.

from openwhisk-runtime-swift.

csantanapr avatar csantanapr commented on June 9, 2024

Yep that correct it would no be the default.
Default behavior is that user coding the action doesnโ€™t have to worry the environment variable with APIHOST will be use they donโ€™t have to specify baseURL

from openwhisk-runtime-swift.

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.