yomorun / yomo

🦖 Stateful Serverless Framework for Geo-distributed Edge AI Infra. with function calling support, write once, run on any model.
https://yomo.run
Apache License 2.0
1.65k stars 128 forks source link

feat: add cron handler for sfn #713

Closed woorui closed 7 months ago

woorui commented 7 months ago

Description

Adding SetCronHandler api for sfn, call it like below:

sfn.SetCronHandler("@every 1s", func(ctx serverless.CronContext) {
    ctx.Write(0x22, []byte("message from cron sfn"))
    ctx.WriteWithTarget(0x22, []byte("message from cron sfn"),  "target-id")
})
vercel[bot] commented 7 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **yomo** | ⬜️ Ignored ([Inspect](https://vercel.com/yomorun/yomo/91dcqVBKrg3zdWddVQCwEmmmJa5k)) | [Visit Preview](https://yomo-git-feat-cron-handler-yomorun.vercel.app) | | Feb 4, 2024 6:25am |
codecov[bot] commented 7 months ago

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (752305d) 59.18% compared to head (e27491c) 59.96%.

Files Patch % Lines
core/metadata.go 0.00% 4 Missing :warning:
sfn.go 96.15% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #713 +/- ## ========================================== + Coverage 59.18% 59.96% +0.77% ========================================== Files 37 37 Lines 2781 2810 +29 ========================================== + Hits 1646 1685 +39 + Misses 1030 1022 -8 + Partials 105 103 -2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.