Skip to content

Commit

Permalink
Requesting desired number of workers
Browse files Browse the repository at this point in the history
  • Loading branch information
tpeczek committed Feb 21, 2024
1 parent 554c92b commit 5e67799
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using System.Linq;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Azure.WebJobs.Host.Scale;
using Microsoft.Extensions.Logging;

namespace RethinkDb.Azure.WebJobs.Extensions.Trigger
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,35 @@
using System;
using System.Threading.Tasks;
using System.Threading.Tasks;
using Microsoft.Azure.WebJobs.Host.Scale;

namespace RethinkDb.Azure.WebJobs.Extensions.Trigger
{
internal class RethinkDbTargetScaler : ITargetScaler
{
public TargetScalerDescriptor TargetScalerDescriptor => throw new NotImplementedException();
#region Fields
private readonly string _functionId;
#endregion

#region Properties
public TargetScalerDescriptor TargetScalerDescriptor { get; }
#endregion

#region Constructor
public RethinkDbTargetScaler(string functionId)
{
_functionId = functionId;

TargetScalerDescriptor = new TargetScalerDescriptor(_functionId);
}
#endregion

#region Methods
public Task<TargetScalerResult> GetScaleResultAsync(TargetScalerContext context)
{
throw new NotImplementedException();
return Task.FromResult(new TargetScalerResult
{
TargetWorkerCount = 1
});
}
#endregion
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public RethinkDbTriggerListener(string functionId, ITriggeredFunctionExecutor ex

_rethinkDbMetricsProvider = new RethinkDbMetricsProvider();
_rethinkDbScaleMonitor = new RethinkDbScaleMonitor(_functionId, _rethinkDbMetricsProvider);
_rethinkDbTargetScaler = new RethinkDbTargetScaler();
_rethinkDbTargetScaler = new RethinkDbTargetScaler(_functionId);
}
#endregion

Expand Down

0 comments on commit 5e67799

Please sign in to comment.