Coder Social home page Coder Social logo

inngest / inngest-kt Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 2.0 225 KB

Kotlin SDK for Inngest w/ Java interoperability

Home Page: https://www.inngest.com

License: Apache License 2.0

Kotlin 63.74% Makefile 0.80% Nix 0.36% Java 34.55% Shell 0.54%
durable-execution inngest java kotlin queues workflow-engine workflows

inngest-kt's Introduction

Inngest Kotlin SDK

๐Ÿšง In development ๐Ÿšง

Inngest SDK for Kotlin with Java interoperability.

Defining a function

Kotlin
import com.inngest.InngestFunction
import com.inngest.FunctionOptions
import com.inngest.FunctionTrigger

val myFunction = InngestFunction(
    FunctionOptions(
        id = "fn-id-slug",
        name = "My function!",
        triggers = arrayOf(FunctionTrigger(event = "user.signup")),
    ),
) { ctx, step ->
    val x = 10

    val res =
        step.run<Int>("add-ten") { ->
            x + 10
        }
    val add: Int =
        step.run("multiply-by-100") {
            res * 100
        }
    step.sleep("wait-one-minute", Duration.ofSeconds(60))

    step.run("last-step") { res * add }

    hashMapOf("message" to "success")
}
Java (Coming soon)

Declaring dependencies

WIP

Contributing [WIP]

To build this in development, set up Java, Kotlin and Gradle locally and run the test server:

make dev-ktor

This runs a ktor web server to test the SDK against the dev server.

To run the spring-boot test server:

make dev-spring-boot

inngest-kt's People

Contributors

albertchae avatar darwin67 avatar djfarrelly avatar kikos0 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

albertchae kikos0

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.