public static void BuildActivityStub<TActivity>() where TActivity : IActivity
Public Shared Sub BuildActivityStub(Of TActivity As IActivity)
public: generic<typename TActivity> where TActivity : IActivity static void BuildActivityStub()
static member BuildActivityStub : unit -> unit when 'TActivity : IActivity
Activity and workflow stubs are generated and compiled on demand by default. This takes about 500ms for each stub. This generally works fine but may cause decision task timeouts for workflows that call a lot of different child workflows or activities.
The default workflow decision task timeout is 10 seconds, so a workflow that creates 22 stubs when its first called will have a decent chance of timing out due to the 500ms * 22 = 11 seconds it will take for the .NET client generate and build the backing classes.
|This is only an issue the first time a stub classes are built, so it'll be very likely that the workflow will proceed the second time it's invoked on the same worker because the generated stub classes are cached.|
You can proactively address this by prebuilding stub classes before starting any workers by calling BuildWorkflowStubTWorkflow, and/or BuildAssemblyStubs(Assembly). After doing this, the specified stubs will already be generated and compiled when the worker starts and begins invoking workflows and activities.,