Closed TonyValenti closed 3 years ago
Hi @TonyValenti been a while.
Sounds like a good idea although it would only make sense if the token value lookups were async. Is that where you were going with this?
Yep. I’ll introduce a new ITokenValueContainerAsync and create the appropriate methods and implementations.
Cool, go for it.
are we there yet? ;)
@dviry I never ended up starting on this. Would love to though. Is your company willing to fund the dev work?
@dviry I'll take a look at implementing this.
@andywilsonuk - As an FYI, when I scoped this out, I felt like a totally new interface was necessary to properly do this. And with a new async interface, I kind of wanted to refectory the sync interfaces to have a similar structure.
I've been too distracted to look at this again since the aborted first attempt but I still have some doubts about the use cases for using string formatting with async.
Any async implementation is by definition IO-bound and round tripping to map tokens to values seems incorrect (even with caching of previously mapped values. What I would probably do is write a custom ITokenValueContainer
and fetch all the mapping values upfront, if there were too many for this to be practical I would instead parse the string into a SegmentedString
, get the list of tokens used from that and fetch them in bulk.
Am I missing a trick? Is there a legitimate use case for requiring async which is strong enough to warrant the significant internal refactoring?
The use case I had was specifically around asynchronous sub-objects. I have a custom container that will evaluate sub objects. For example: {Matter.Client.First_Name}
What I wanted to be able to do is make the sub-evaluation async. Essentially, all "basic" properties would be loaded and cached and child child objects would be asynchronously loaded and cached as requested.
Oh I see, I'll chew that over.
OK, I'll admit it, I'm not going to do this. Maybe one day...
Hi @andywilsonuk - Any objection if I add some interfaces for working with Async objects? Essentially: