BlobChangeFeedClient class
BlobChangeFeedClient.
Bkz. https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-change-feed?tabs=azure-portal
Oluşturucular
| Blob |
BlobChangeFeedClient örneği oluşturur. |
| Blob |
BlobChangeFeedClient örneği oluşturur. |
Yöntemler
| from |
Bağlantı dizesinden bir BlobChangeFeedClient örneği oluşturur. |
| list |
Belirtilen hesaptaki tüm değişiklik akışı olaylarını listelemek için zaman uyumsuz bir yinelenebilir yineleyici döndürür. .byPage(), değişiklik akışı olaylarını sayfalarda listelemek için zaman uyumsuz bir yinelenebilir yineleyici döndürür.
Örnek
Örnek
İşaretçi ile disk belleği kullanma örneği:
|
Oluşturucu Ayrıntıları
BlobChangeFeedClient(string, Pipeline)
BlobChangeFeedClient örneği oluşturur.
new BlobChangeFeedClient(url: string, pipeline: Pipeline)
Parametreler
- url
-
string
"https://myaccount.blob.core.windows.net" gibi Azure Depolama blob hizmetine işaret eden bir İstemci dizesi. AnonymousCredential kullanıyorsanız , "https://myaccount.blob.core.windows.net?sasString" gibi bir SAS ekleyebilirsiniz.
- pipeline
- Pipeline
Varsayılan işlem hattı oluşturmak veya özelleştirilmiş bir işlem hattı sağlamak için newPipeline() çağrısında bulunabilirsiniz.
BlobChangeFeedClient(string, StorageSharedKeyCredential | AnonymousCredential | TokenCredential, StoragePipelineOptions, BlobChangeFeedClientOptions)
BlobChangeFeedClient örneği oluşturur.
new BlobChangeFeedClient(url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions, changeFeedClientOptions?: BlobChangeFeedClientOptions)
Parametreler
- url
-
string
"https://myaccount.blob.core.windows.net" gibi Azure Depolama blob hizmetine işaret eden bir İstemci dizesi. AnonymousCredential kullanıyorsanız , "https://myaccount.blob.core.windows.net?sasString" gibi bir SAS ekleyebilirsiniz.
- credential
-
StorageSharedKeyCredential | AnonymousCredential | TokenCredential
AnonymousCredential, StorageSharedKeyCredential gibi veya hizmete yönelik isteklerin kimliğini doğrulamak için @azure/identity paketindeki herhangi bir kimlik bilgisi. TokenCredential arabirimini uygulayan bir nesne de sağlayabilirsiniz. Belirtilmezse, AnonymousCredential kullanılır.
- options
- StoragePipelineOptions
Opsiyonel. HTTP işlem hattını yapılandırma seçenekleri.
@azure/identitydefaultAzureCredential kullanma örneği:
const account = "<storage account name>";
const defaultAzureCredential = new DefaultAzureCredential();
const blobChangeFeedClient = new BlobChangeFeedClient(
`https://${account}.blob.core.windows.net`,
defaultAzureCredential
);
Hesap adı/anahtarı kullanan örnek:
const account = "<storage account name>"
const sharedKeyCredential = new StorageSharedKeyCredential(account, "<account key>");
const blobChangeFeedClient = new BlobChangeFeedClient(
`https://${account}.blob.core.windows.net`,
sharedKeyCredential
);
- changeFeedClientOptions
- BlobChangeFeedClientOptions
Yöntem Ayrıntıları
fromConnectionString(string, StoragePipelineOptions, BlobChangeFeedClientOptions)
Bağlantı dizesinden bir BlobChangeFeedClient örneği oluşturur.
static function fromConnectionString(connectionString: string, options?: StoragePipelineOptions, changeFeedClientOptions?: BlobChangeFeedClientOptions): BlobChangeFeedClient
Parametreler
- connectionString
-
string
Bir Azure depolama hesabının hesap bağlantı dizesi veya SAS bağlantı dizesi.
[ Not - Hesap bağlantı dizesi yalnızca NODE.JS çalışma zamanında kullanılabilir. ] Hesap bağlantı dizesi örneği - SAS bağlantı dizesi örneği DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net - BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString
- options
- StoragePipelineOptions
Opsiyonel. HTTP işlem hattını yapılandırma seçenekleri.
- changeFeedClientOptions
- BlobChangeFeedClientOptions
Döndürülenler
listChanges(BlobChangeFeedListChangesOptions)
Belirtilen hesaptaki tüm değişiklik akışı olaylarını listelemek için zaman uyumsuz bir yinelenebilir yineleyici döndürür.
.byPage(), değişiklik akışı olaylarını sayfalarda listelemek için zaman uyumsuz bir yinelenebilir yineleyici döndürür.
for await söz dizimi kullanan örnek:
let i = 1;
for await (const event of blobChangeFeedClient.listChanges()) {
console.log(`Event ${i++}, type: ${event.eventType}`);
}
Örnek iter.next() kullanımı:
let i = 1;
const iter = blobChangeFeedClient.listChanges();
let eventItem = await iter.next();
while (!eventItem.done) {
console.log(`Event ${i++}, type: ${eventItem.eventType}`);
eventItem = await iter.next();
}
Örnek byPage() kullanımı:
// passing optional maxPageSize in the page settings
let i = 1;
for await (const eventPage of blobChangeFeedClient.listChanges().byPage({ maxPageSize: 20 })) {
if (eventPage.events) {
for (const event of eventPage.events) {
console.log(`Event ${i++}, type: ${event.eventType}`);
}
}
}
İşaretçi ile disk belleği kullanma örneği:
let i = 1;
let iterator = blobChangeFeedClient.listChanges().byPage({ maxPageSize: 2 });
let eventPage = (await iterator.next()).value;
if (eventPage.events) {
for (const container of eventPage.events) {
console.log(`Event ${i++}, type: ${event.eventType}`);
}
}
// Gets next marker
let marker = eventPage.continuationToken;
// Passing next marker as continuationToken
iterator = blobChangeFeedClient
.listChanges()
.byPage({ continuationToken: marker, maxPageSize: 10 });
eventPage = (await iterator.next()).value;
if (eventPage.events) {
for (const container of eventPage.events) {
console.log(`Event ${i++}, type: ${event.eventType}`);
}
}
function listChanges(options?: BlobChangeFeedListChangesOptions): PagedAsyncIterableIterator<BlobChangeFeedEvent, BlobChangeFeedEventPage, PageSettings>
Parametreler
- options
- BlobChangeFeedListChangesOptions
Değişiklik akışı olaylarını listeleme seçenekleri.
Döndürülenler
Disk belleğini destekleyen asyncIterableIterator.