GithubHelp home page GithubHelp logo

Comments (9)

sec avatar sec commented on May 31, 2024 1

I see, maybe you can take a look ay my implementation as a reference, I've tested and it works under 8, until we get official docs.

from orleans.

sec avatar sec commented on May 31, 2024

Hi.
I hit the same issue, documentation and samples are not yet updated to 8.0, as you also saw :)

Based on your code, something like this should work:

    internal static IServiceCollection AddAzureShardedGrainStorage(
        this IServiceCollection services,
        string name,
        Action<OptionsBuilder<AzureShardedStorageOptions>> configureOptions = null)
    {
        configureOptions?.Invoke(services.AddOptions<AzureShardedStorageOptions>(name));

        services.ConfigureNamedOptionForLogging<AzureShardedStorageOptions>(name);

        return services.AddGrainStorage(name, AzureShardedGrainStorageFactory.Create);
    }

But I'm 100% sure if this is all that's needed after migrate to v8, because right know my custom provider it not working, method Participate is not called during Silo startup :(

edit: found out the issue, be sure to return your strong typed Storage class, not IGrainStorage as in the old example. Ex. public static AzureShardedGrainStorage Create(IServiceProvider services, string name)

from orleans.

JsAndDotNet avatar JsAndDotNet commented on May 31, 2024

Thanks @sec for the info. That would get past the build error, but wouldn't get it running (I did test to make sure). Hopefully the Orleans team might have some more info?

@ReubenBond - do you know how 'Custom Grain Storage' should be set up in Orleans 8 please? Are there any docs anywhere?

If there aren't any current docs and you can show me how to fix it, I could update/create the tutorial for Orleans 8. Here is an example of my standard of writing.

from orleans.

JsAndDotNet avatar JsAndDotNet commented on May 31, 2024

I've had a look at the above mentioned sample. I think it's missing a lot of new stuff.

I checked out the release notes, but couldn't see any pointers.

I checked out Orleans Contrib and found the Mongo provider, but I'm really struggling to work out the changes.

Does anyone from the Orleans team will know how to help please?

from orleans.

sec avatar sec commented on May 31, 2024

What do you miss exactly or maybe what problem are you facing? After those code changes and change in Storage factory return type, your provider should work - what errors are you getting?

from orleans.

JsAndDotNet avatar JsAndDotNet commented on May 31, 2024

The same thing as you whereby Participate(ISiloLifecycle lifecycle) isn't called on the silo startup.

If you check out the Mongo Provider, it seems to be done in a very different manner in V8, but that provider is quite complex, so I'm having trouble working out exactly what's needed.

Did you get your repo working with the provider calling Participate?

from orleans.

sec avatar sec commented on May 31, 2024

Yes, you need to change the return type in your storage factory to be like this

public static class AzureShardedGrainStorageFactory
{
    public static AzureShardedGrainStorage Create(IServiceProvider services, string name)
    {
        var options = services.GetRequiredService<IOptionsMonitor<AzureShardedStorageOptions>>().Get(name);
        return ActivatorUtilities.CreateInstance<AzureShardedGrainStorage>(services, options, name);
    }
}

from orleans.

JsAndDotNet avatar JsAndDotNet commented on May 31, 2024

I couldn't get it going, so I went to the Orleans repo and re-modelled my stuff based on the Redis provider.

Thanks for your help.

The tutorial is still out of date, so I'll leave this open as notification that the docs need updating. Appreciate the team have a lot on.

from orleans.

JsAndDotNet avatar JsAndDotNet commented on May 31, 2024

For anyone else who gets stuck, I now have the persistence provider working. Code can be found here.

It's based on the Redis provider, which is a nice example to follow.

I'm going to close this issue as my problem is resolved and hopefully others will be able to follow these examples.

from orleans.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.