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

Minor Batch Enhancements #368

Merged
merged 10 commits into from
May 2, 2022
Merged

Conversation

liquizard
Copy link
Contributor

Status Type ⚠️ Core Change
Ready Feature/Bug No (minor changes)

Problem

Minor enhancements to Batch requests + Token Wallets

  • load mulltiple TokenWallet instance via the batch composer
            // init batch
            var batch = new SolanaRpcBatchWithCallbacks(client);
            batch.AutoExecute(BatchAutoExecuteMode.ExecuteWithFatalFailure, 50);

            // request multilpe wallets
            var walletPromise1 = TokenWallet.LoadAsync(batch, tokens, pubkey1);
            var walletPromise2 = TokenWallet.LoadAsync(batch, tokens, pubkey2);
            var walletPromise3 = TokenWallet.LoadAsync(batch, tokens, pubkey3);
            var walletPromise4 = TokenWallet.LoadAsync(batch, tokens, pubkey4);
            batch.Flush();

            // enjoy your wallets
            var wallet1 = walletPromise1.Result;
            ...

Other changes (e.g. bug fixes, small refactors)

  • added overload to TokenWalletFilterList
  • bugfix Batch.Flush() on empty batches

@liquizard liquizard merged commit a8fdbe6 into bmresearch:master May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants