Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INN-2310: Implement step.sendEvent #21

Merged
merged 5 commits into from
Feb 25, 2024
Merged

INN-2310: Implement step.sendEvent #21

merged 5 commits into from
Feb 25, 2024

Conversation

KiKoS0
Copy link
Collaborator

@KiKoS0 KiKoS0 commented Feb 24, 2024

Add support for step.sendEvent to send events out.

Introduces a small refactor to the CommHandler http client to dry out API calls.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

ktlint

inngest-test-server/src/main/kotlin/com/inngest/App.kt|56 col 11| Property name should use the screaming snake case notation when the value can not be changed

inngest-core/src/main/kotlin/com/inngest/Comm.kt Outdated Show resolved Hide resolved
inngest-core/src/main/kotlin/com/inngest/Comm.kt Outdated Show resolved Hide resolved
inngest-core/src/main/kotlin/com/inngest/Comm.kt Outdated Show resolved Hide resolved
inngest-core/src/main/kotlin/com/inngest/Comm.kt Outdated Show resolved Hide resolved
inngest-core/src/main/kotlin/com/inngest/Function.kt Outdated Show resolved Hide resolved
inngest-core/src/main/kotlin/com/inngest/Step.kt Outdated Show resolved Hide resolved
inngest-core/src/main/kotlin/com/inngest/Step.kt Outdated Show resolved Hide resolved
inngest-core/src/main/kotlin/com/inngest/Step.kt Outdated Show resolved Hide resolved
inngest-core/src/main/kotlin/com/inngest/Step.kt Outdated Show resolved Hide resolved
inngest-test-server/src/main/kotlin/com/inngest/App.kt Outdated Show resolved Hide resolved
@KiKoS0 KiKoS0 force-pushed the implement-send-event branch from 007eb3a to 3eb4eb1 Compare February 24, 2024 16:22
Base automatically changed from fix-interop-issues to main February 24, 2024 16:24
@KiKoS0 KiKoS0 force-pushed the implement-send-event branch from 3eb4eb1 to b229b33 Compare February 24, 2024 17:02
@albertchae albertchae changed the title Implement step.sendEvent INN-2310: Implement step.sendEvent Feb 24, 2024
Copy link

linear bot commented Feb 24, 2024

INN-2310 Add sendEvent

Copy link
Contributor

@darwin67 darwin67 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non blocking comments.
if you're not planning to address them in this PR, would be best to add some TODO comments so it's clear what needs to be revisit later on.

inngest-core/src/main/kotlin/com/inngest/Step.kt Outdated Show resolved Hide resolved
fun sendEvent(
id: String,
events: Array<InngestEvent>,
) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gotcha, I'll address them in this PR 👍

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out this is a bit tricky, we left a TODO to investigate later

return
} catch (e: StateNotFound) {
val response = CommHandler.sendEvent<SendEventsResponse>(events)
throw StepInterruptSendEventException(id, hashedId, response!!.ids)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor, let's see if we can change the return type of CommHandler.sendEvent to guarantee non null response

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we'll investigate this later too

@albertchae albertchae merged commit 33d2275 into main Feb 25, 2024
7 checks passed
@albertchae albertchae deleted the implement-send-event branch February 25, 2024 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants