public DocumentsRegistryGrain([PersistentState("state", "MemoryGrainStorage")] IPersistentState <List <Document> > state, IAuthorizationService authorizationService) { _state = state; _authorizationService = authorizationService; }
public IdentityRoleGrain( ILookupNormalizer normalizer, [PersistentState("IdentityRole", OrleansIdentityConstants.OrleansStorageProvider)] IPersistentState <RoleGrainState <TRole> > data) { _data = data; _normalizer = normalizer; }
public GameProvider( [PersistentState("games", "GameProviderStore")] IPersistentState <GameProviderState> games, ILogger <GameProvider> logger) { _games = games; _logger = logger; }
public BMSService( [PersistentState("TDXX", "TDXXCache")] IPersistentState <VOCache> tdxx, [PersistentState("LYXX", "LYXXCache")] IPersistentState <VOCache> lyxx) { _tdxx = tdxx; _lyxx = lyxx; }
public UserIdFactoryGrain( [PersistentState("CurUserId", StorageProviders.DefaultProviderName)] IPersistentState <Int64> curUserId, ILogger <UserGrain> logger) { _curUserId = curUserId; _logger = logger; }
public TodoGrain( ILogger <TodoGrain> logger, [PersistentState("State")] IPersistentState <State> state) { _logger = logger; _state = state; }
public ClientGrain( ILogger <ClientGrain> logger, [PersistentState(CLIENT_STORAGE, Constants.STORAGE_PROVIDER)] IPersistentState <ClientState> clientState) { _logger = logger; _clientState = clientState; }
public JobIdGrain( [PersistentState(nameof(JobIdGrain), Constants.JobIdStoreName)] IPersistentState <JobIdState> state, IOptions <JobTrackerConfig> options) { _state = state; _options = options; }
public MessageGrain( ILogger <MessageGrain> logger, [PersistentState("messages", "sqlite")] IPersistentState <List <string> > messageState) { _messageState = messageState; _subsManager = new(TimeSpan.FromMinutes(5), logger, "subs"); }
public WorkflowExecutorGrain( [PersistentState(nameof(_flowState))] IPersistentState <WorkflowState> flowState, ILogger <WorkflowExecutorGrain> logger) { _flowState = flowState; _logger = logger; }
private void CreateSmartContractState() { var block = new TestBlock { Coinbase = contractOwnerAddress, Number = 2 }; var message = new TestMessage { ContractAddress = contractAddress, GasLimit = (Gas)(ulong)10000, Sender = punter1Address, Value = 0 }; this.transactionExecutor = Substitute.For <IInternalTransactionExecutor>(); persistentState = new InMemoryState(); this.smartContractState = new TestSmartContractState( block, message, persistentState, null, transactionExecutor, () => (ulong)0, new TestInternalHashHelper() ); }
public ServerDirectoryGrain( ILogger <ServerDirectoryGrain> logger, [PersistentState(Constants.STORAGE_PROVIDER)] IPersistentState <ServerDirectoryState> directoryState) { _logger = logger; _directory = directoryState; }
public CMSService( [PersistentState("CustomerManager", "CustomerManagerCache")] IPersistentState <CustomerManager> customerManager, [PersistentState("GroupManager", "GroupManagerCache")] IPersistentState <GroupManager> groupManager) { _customerManager = customerManager; _groupManager = groupManager; }
public AccountGrain( [TransactionalState("balanceState", "Storage1")] ITransactionalState <BalanceState> balanceState, [PersistentState("nameState", "Storage1")] IPersistentState <NameState> nameState) { _balanceState = balanceState ?? throw new ArgumentNullException(nameof(balanceState)); _nameState = nameState ?? throw new ArgumentNullException(nameof(nameState)); }
public VoteGrain( [PersistentState("votes", storageName: "votes")] IPersistentState <Dictionary <string, int> > state, ILogger <VoteGrain> logger) { _logger = logger; _state = state; }
public ActivityTestGrain([PersistentState(Constants.StorageProviderName, Constants.StorageProviderName)] IPersistentState <ActivityState> state, IActivityContextAccessor activityContextAccessor, ITenantAccessor tenantAccessor, IStreamFactory streamFactory = null) { _activityContextAccessor = activityContextAccessor; _tenantAccessor = tenantAccessor; _streamFactory = streamFactory; _state = state; }
public UserGrain( // grain state is not loaded at the time it is injected into constructor, // so accessing it is invalid at that time, the state will be loaded before `OnActiveAsync` is called. [PersistentState("UserState", "sqlite")] IPersistentState <UserState> userState) { // 注入的时候并没有读取, 在OnActivateAsync调用前保证是读取了的 _userState = userState; }
public FeedSubscriberGrain( [PersistentState("translationGrainState", STORAGE_NAME)] IPersistentState <FeedSubscriberGrainState> state, IFeedSubscriber <TranslationState> feedSubscriber ) { this.state = state; this.feedSubscriber = feedSubscriber; }
public PersistentGrain( ILogger <PersistentGrain> logger, [PersistentState("state")] IPersistentState <PersistentGrainState> persistentState) { this.logger = logger; this.persistentState = persistentState; }
public UserGrain( [PersistentState("profile", "profileStore")] IPersistentState <ProfileState> profile, IHttpClientFactory httpClientFactory, ILogger <UserGrain> logger) { _profile = profile; _httpClientFactory = httpClientFactory; _logger = logger; }
public SensorTypeAProcessorGrain ( [PersistentState(stateName: "Measurements", storageName: nameof(SensorTypeAProcessorGrain))] IPersistentState <SensorTypeAState> persistentState, ILogger <SensorTypeAProcessorGrain> logger ) { this.persistentState = persistentState; this.logger = logger; }
public Cow( [PersistentState("CowOwnerId", "FileStorage")] IPersistentState <Guid> ownerId, [PersistentState("CowLocation", "FileStorage")] IPersistentState <Location> location, [PersistentState("CowItinerary", "FileStorage")] IPersistentState <List <Point> > trajectory) { _trajectory = trajectory; _ownerId = ownerId; _location = location; }
public UserVerificationGrain([PersistentState(nameof(UserVerificationState))] IPersistentState <UserVerificationState> verificationState, IDataRetriever <HashSet <string> > blacklistedEmails, ILogger <UserVerificationGrain> logger) { _verificationState = verificationState; _blacklistedEmails = blacklistedEmails; _logger = logger; }
public SearchGrain( [PersistentState(nameof(SearchGrain))] IPersistentState <SearchState> search, ILogger <SearchGrain> logger, IHostApplicationLifetime hostAppLifetime) { _search = search; _logger = logger; _hostAppLifetime = hostAppLifetime; }
/// <summary> /// Constructor /// </summary> /// <param name="factory">factory logger</param> /// <param name="client">event store client</param> /// <param name="persist">event store persistent subscription client</param> public PrimeGrain(ILoggerFactory factory, IESService <int> es_service, IRXService <int> rx_service, [PersistentState("primes", GrainConst.Storage)] IPersistentState <PrimeAggregate> aggregate, EventStorePersistentSubscriptionsClient persist) { _logger = factory.CreateLogger <PrimeGrain>(); _es_service = es_service; _rx_service = rx_service; _aggregate = aggregate; PrimeGrain_Persist(persist); PrimeGrain_Stream(factory); }
public DictionaryEntryGrain( // Inject some storage. We will use the "definitions" storage provider configured in Program.cs // and we will call this piece of state "def", to distinguish it from any other state we might want to have [PersistentState(stateName: "def", storageName: "definitions")] IPersistentState <DictionaryEntryState> defs, ReferenceDataService referenceDataService) { _state = defs; _referenceDataService = referenceDataService; }
public OrderGrain( [PersistentState(nameof(OrderGrain))] IPersistentState <OrderState> order, IGrainFactory grainFactory, ILogger <OrderGrain> logger, IHostApplicationLifetime hostAppLifetime) { _order = order; _grainFactory = grainFactory; _logger = logger; _hostAppLifetime = hostAppLifetime; }
protected SmartContract(ISmartContractState smartContractState) { CultureInfo.CurrentCulture = new CultureInfo("en-US"); this.gasMeter = smartContractState.GasMeter; this.Block = smartContractState.Block; this.getBalance = smartContractState.GetBalance; this.internalTransactionExecutor = smartContractState.InternalTransactionExecutor; this.internalHashHelper = smartContractState.InternalHashHelper; this.Message = smartContractState.Message; this.PersistentState = smartContractState.PersistentState; this.smartContractState = smartContractState; }
public CacheGrain( IOptions <CacheOptions> options, ISystemClock clock, [PersistentState("State", OutkeepProviderNames.OutkeepCache)] IPersistentState <CacheGrainState> state, [PersistentState("Flags", OutkeepProviderNames.OutkeepCache)] IPersistentState <CacheGrainFlags> flags, [WeakActivationState(OutkeepProviderNames.OutkeepMemoryResourceGovernor)] IWeakActivationState <ActivityState> activity) { _options = options?.Value ?? throw new ArgumentNullException(nameof(options)); _clock = clock ?? throw new ArgumentNullException(nameof(clock)); _state = state?.AsConflater() ?? throw new ArgumentNullException(nameof(state)); _flags = flags?.AsConflater() ?? throw new ArgumentNullException(nameof(flags)); _activity = activity ?? throw new ArgumentNullException(nameof(activity)); }
public AddressMapperTests() { mContractLogger = new Mock <IContractLogger>(); state = new InMemoryState(); mContractState = new Mock <ISmartContractState>(); mInternalExecutor = new Mock <IInternalTransactionExecutor>(); mContractState.Setup(x => x.PersistentState).Returns(state); mContractState.Setup(x => x.ContractLogger).Returns(mContractLogger.Object); mContractState.Setup(x => x.InternalTransactionExecutor).Returns(mInternalExecutor.Object); contractAddress = "0x0000000000000000000000000000000000000001".HexToAddress(); ownerAddress = "0x0000000000000000000000000000000000000002".HexToAddress(); primaryAddress = "0x0000000000000000000000000000000000000003".HexToAddress(); secondaryAddress = "0x0000000000000000000000000000000000000004".HexToAddress(); }