-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add README and rename ZLambdaApp to ZLambda (#82)
- Loading branch information
Showing
9 changed files
with
67 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 5 additions & 6 deletions
11
lambda-example/src/main/scala/zio/lambda/example/SimpleHandler.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
package zio.lambda.example | ||
|
||
import zio._ | ||
import zio.Console._ | ||
import zio.lambda.Context | ||
import zio.lambda.ZLambdaApp | ||
import zio._ | ||
import zio.lambda._ | ||
|
||
object SimpleHandler extends ZLambdaApp[CustomEvent, CustomResponse] { | ||
object SimpleHandler extends ZLambda[CustomEvent, String] { | ||
|
||
override def apply(event: CustomEvent, context: Context): RIO[ZEnv, CustomResponse] = | ||
override def apply(event: CustomEvent, context: Context): RIO[ZEnv, String] = | ||
for { | ||
_ <- printLine(event.message) | ||
} yield CustomResponse("Handler ran successfully") | ||
} yield "Handler ran successfully" | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
package zio.lambda.internal | ||
|
||
import zio._ | ||
import zio.lambda.ZLambdaApp | ||
import zio.lambda.ZLambda | ||
|
||
trait LambdaLoader { | ||
def loadLambda: UIO[Either[Throwable, ZLambdaApp[_, _]]] | ||
def loadLambda: UIO[Either[Throwable, ZLambda[_, _]]] | ||
} | ||
|
||
object LambdaLoader { | ||
def loadLambda: URIO[LambdaLoader, Either[Throwable, ZLambdaApp[_, _]]] = | ||
def loadLambda: URIO[LambdaLoader, Either[Throwable, ZLambda[_, _]]] = | ||
ZIO.serviceWithZIO(_.loadLambda) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters