Git Product home page Git Product logo

Comments (3)

itowlson avatar itowlson commented on June 11, 2024 2

(Incidentally this would have been a challenge for HTTP too had wise Lann not wisely made base optional, the wise fellow.)

from spin.

tpmccallum avatar tpmccallum commented on June 11, 2024

The documentation in the https://developer.fermyon.com/spin/v2/triggers file will need to be amended if/when this change is implemented. The triggers page currently gives the following instructions re: multiple trigger applications via spin new and spin add:


Currently, only the HTTP template supports the spin add command. If you wish to use spin add to build an application with multiple triggers, including a Redis trigger, you should begin with the Redis trigger application. Then, spin add your HTTP trigger component(s) as demonstrated below. Please note that additional Redis trigger components cannot be added via spin add at this time.

# Start with a Redis trigger application
$ spin new -t redis-rust trigger-example
Description: A multiple trigger example
Redis address: redis://localhost:6379
Redis channel: one
# Change into to the application directory
$ cd trigger-example 
# Create HTTP trigger application
$ spin add -t http-rust http-trigger-example  
Description: A HTTP trigger example
HTTP path: /...

from spin.

itowlson avatar itowlson commented on June 11, 2024

Looks like there's a smol challenge here.

A Redis application requires an application.trigger.redis.address entry. When we create a new spin.toml file (spin new), we can safely prompt for that and include that and all is well.

However, when we add a component to an existing spin.toml file, we need to be smarter. We should prompt for and add the address only if that entry doesn't yet exist.

The subsystems to do this don't currently exist in the templates crate. (Which is not to say they can't be added - they can definitely be added, it just means there's more to this than making a component snippet.)

from spin.

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.