Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design Proposal: Integration with DataFlow (TPL) #73

Open
branimirangelov opened this issue Jan 27, 2021 · 0 comments
Open

Design Proposal: Integration with DataFlow (TPL) #73

branimirangelov opened this issue Jan 27, 2021 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@branimirangelov
Copy link
Collaborator

branimirangelov commented Jan 27, 2021

Background

DataFlow (TPL) is high level library for writing data flow pipelines (based on TPL). The library is not part of .NET Framework, but it is distributed as an external NuGet. However it is well supported by Microsoft with mid-term roadmap to .NET 6.0 and beyond. ISourceBlock and ITargetBlock abstractions fit naturally with Perper and Perper fits well with DataFlow further extending its parallelization capabilities beyond a single machine.

Proposal

  1. Support ISourceBlock and ITargetBlock in addition to IAsyncEnumerable as function signatures.
public ITargetBlock<string> RunAsync([PerperTrigger] ISourceBlock<string> input)
{
    // create arbitrary data flow network 
}

Note: Providing custom ISourceBlock implementation will be very similar to IAsyncEnumerable implementation in Perper. Receiving ITargetBlock messages will be part of the binders / converters logic in the extension (similarly to handling IAsyncEnumerable)

  1. Add extension method AsSourceBlock() of Perper IStream abstraction.
var realTime = await _context.StreamFunctionAsync<dynamic>(nameof(RealTimeMinuteBars), symbols);
// realTime.AsSourceBlock() can be used to incorporate it in a data flow network
  1. Add ITargetBlock as function signature for blank streams in addition to IAsyncCollector.
public async Task<string> RunAsync(
            [PerperTrigger(ParameterExpression="{\"stream\":0}")] (string, string, long) parameters, 
            [Perper] ITargetBlock<string> symbols)
@branimirangelov branimirangelov added this to the Release 0.7 milestone Jan 27, 2021
bojidar-bg added a commit that referenced this issue Feb 1, 2021
bojidar-bg added a commit that referenced this issue Feb 8, 2021
* fix: rework PerperBinarySerializer, making it more useful

* chore: Add versioned image tagging to fabric workflow

* chore: add logging

* feat: Implement Filter, Replay, and Query

* chore: Reformat and bump version to 0.6.0-alpha6

* feat: Unit test mocks for IState, IStream, IContext, and IAgent

Addresses part of #55

* refactor: Change Test -> Fake, make mocks more usable

* feat: add DI support in custom handler

* fix: temp fix for compile error

* feat: Add extension methods for converting to/from Dataflow blocks

Implements #73 in the simplest manner.

Co-authored-by: Branimir Angelov <[email protected]>
@bojidar-bg bojidar-bg added the enhancement New feature or request label Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants