Comments (5)
Nice, that's interesting! I don't have any predisposition against Base
classes, so give it a try. I'm curious to see what you can come up with. Thanks a ton!
from durablefunctions.fsharp.
struggling to see how to do this in a non breaking way - thought I could re-define the builder to use #DurableOrchestrationContextBase
which compiles but the orchestration
ce still expects a DurableOrchestrationContext
so inheritance doesn't work as I had hoped
from durablefunctions.fsharp.
You should probably replace Context
to ContextBase
everywhere, and then you should be good, no?
from durablefunctions.fsharp.
yeah that was my first attempt and that works but that means function definitions such as this break
[<FunctionName("HelloSequence")>]
let Run ([<OrchestrationTrigger>] context: DurableOrchestrationContext) =
context |>
orchestrator {
let! hello1 = Activity.callByName<string> "SayHello" "Tokyo"
let! hello2 = Activity.callByName<string> "SayHello" "Seattle"
let! hello3 = Activity.callByName<string> "SayHello" "London"
// returns ["Hello Tokyo!", "Hello Seattle!", "Hello London!"]
return [hello1; hello2; hello3]
}
with
error FS0001: Type mismatch. Expecting a 'DurableOrchestra
tionContext -> 'a' but given a 'DurableOrchestrationContextBase -> System.Threading.Tasks.Task<string list>'
The type 'DurableOrchestrationContext' does not match the type 'DurableOrchestrationContextBase'
It would have to change to
[<FunctionName("HelloSequence")>]
let Run ([<OrchestrationTrigger>] context: DurableOrchestrationContextBase) =
context |>
orchestrator {
let! hello1 = Activity.callByName<string> "SayHello" "Tokyo"
let! hello2 = Activity.callByName<string> "SayHello" "Seattle"
let! hello3 = Activity.callByName<string> "SayHello" "London"
// returns ["Hello Tokyo!", "Hello Seattle!", "Hello London!"]
return [hello1; hello2; hello3]
}
so anyone taking the latest version of the library would have to change their code - I was hoping that could be avoided
from durablefunctions.fsharp.
Ah, thanks for the clarification!
Am I wrong or is it the only example that breaks? If so, I'm fine with this. Honestly, I think this call is awkward anyway, so maybe change it to
let workflow = orchestrator {
let! hello1 = Activity.callByName<string> "SayHello" "Tokyo"
let! hello2 = Activity.callByName<string> "SayHello" "Seattle"
let! hello3 = Activity.callByName<string> "SayHello" "London"
// returns ["Hello Tokyo!", "Hello Seattle!", "Hello London!"]
return [hello1; hello2; hello3]
}
Orchestrator.run (workflow, context)
while you are here. This shouldn't require the type change then.
from durablefunctions.fsharp.
Related Issues (9)
- Implement orchestrators calling suborchestrators HOT 1
- Multiple Activity.All in single orchestration ce ? HOT 1
- Eternal orchestrations HOT 9
- The Hello World application inside getting started doesn't start the orchestrator HOT 1
- A version of All for fire-fire-and-forget fan-out HOT 3
- POSTing input parameter HOT 3
- Function will not start when using Paket for package management HOT 4
- Catch exceptions raised by ActivityFunctions HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from durablefunctions.fsharp.