Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd5600c1

Browse files
authored
Apply suggestions from code review
1 parent2668033 commitd5600c1

File tree

1 file changed

+12
-9
lines changed
  • src/connections/sources/catalog/libraries/server/csharp

1 file changed

+12
-9
lines changed

‎src/connections/sources/catalog/libraries/server/csharp/index.md‎

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ To get started with the Analytics-CSharp library:
6767
| `analyticsErrorHandler`|Thedefaultissetto `null`. <br>Thissetsanerrorhandlertohandleerrorshappenedinanalytics.|
6868
| `storageProvider`|Thedefaultissetto `DefaultStorageProvider`. <br>Thissetshowyouwantyourdatatobestored. `DefaultStorageProvider`isusedbydefaultwhichstoresdatatolocalstorage. `InMemoryStorageProvider`isalsoprovidedinthelibrary.Youcanalsowriteyourownstoragesolutionbyimplementing `IStorageProvider`and `IStorage`.|
6969
| `httpClientProvider`|Thedefaultissetto `DefaultHTTPClientProvider`. <br>Thissetsahttpclientproviderforanalyticsusetodonetworkactivities.ThedefaultproviderusesSystem.Net.Httpfornetworkactivities.|
70-
| `flushPolicies`|Defaultsetto `null`.<br>Thissetcustomflushpoliciestotellanalyticswhenandhowtoflush.Bydefault,itconverts `flushAt`and `flushInterval`to `CountFlushPolicy`and `FrequencyFlushPolicy`.Ifavalueisgiven,itoverwrites `flushAt`and `flushInterval`.|
70+
| `flushPolicies`|Thedefaultissetto `null`. <br>Thissetscustomflushpoliciestotellanalytics when and how to flush. By default, it converts `flushAt` and `flushInterval` to `CountFlushPolicy` and `FrequencyFlushPolicy`. If a value is given, it overwrites `flushAt` and `flushInterval`. |
7171

7272
## Tracking Methods
7373

@@ -326,10 +326,13 @@ analytics.Reset()
326326
```
327327

328328

329-
##Controlling Upload WithFlushPolicies
330-
Tomoregranularlycontrol when events are uploaded you can use `FlushPolicies`.**This will override any setting on `flushAt` and `flushInterval`, but you can use `CountFlushPolicy` and `FrequencyFlushPolicy` to have the same behaviour respectively.**
329+
## Flushpolicies
330+
Tomoregranularlycontrol when events are uploaded you can use `FlushPolicies`.
331331

332-
AFlushPolicydefinesthestrategyfordeciding when to flush, this can be on an interval, on a certain time of day, after receiving a certain number of events or even after receiving a particular event. This gives you even more flexibility on when to send event to Segment.
332+
>warning ""
333+
> `FlushPolicies`overridesanysettingon `flushAt`and `flushInterval`,butyoucanuse `CountFlushPolicy`and `FrequencyFlushPolicy`tohavethesamebehavior.
334+
335+
AFlushPolicydefinesthestrategyfordecidingwhentoflush.Thiscanbeonaninterval,onacertaintimeofday,afterreceivingacertainnumberofeventsorevenafterreceivingaparticularevent.ThisgivesyouevenmoreflexibilityonwhentosendaneventtoSegment.
333336

334337
Tomakeuseofflushpoliciesyoucansetthemintheconfigurationoftheclient:
335338
```csharp
@@ -345,16 +348,16 @@ To make use of flush policies you can set them in the configuration of the clien
345348

346349
Thatmeansonlythefirstpolicytoreach `ShouldFlush`getstotriggeraflushatatime.Intheexampleaboveeithertheeventcountgetsto5orthetimerreaches500ms,whatevercomesfirstwilltriggeraflush.
347350

348-
WehaveseveralstandardFlushPolicies:
351+
SegmenthasseveralstandardFlushPolicies:
349352
- `CountFlushPolicy`triggerswheneveracertainnumberofeventsisreached
350353
- `FrequencyFlushPolicy`triggersonanintervalofmilliseconds
351354
- `StartupFlushPolicy`triggersonclientstartuponly
352355

353356
### Adding or removing policies
354357

355-
OneofthemainadvantagesofFlushPoliciesisthatyoucanaddandremovepoliciesonthefly.Thisisverypowerful when you want to reduce or increase the amount of flushes.
358+
OneofthemainadvantagesofFlushPoliciesisthatyoucanchoosetoaddandremovepolicies.Thisisverypowerful when you want to reduce or increase the amount of flushes.
356359

357-
Forexampleyoumightwanttodisableflushesifyoudetecttheuserhasnonetwork:
360+
Forexample,youmightwanttodisableflushesifyoudetecttheuserhasnonetwork:
358361
```csharp
359362
// listen to network changes
360363
if (noNetwork) {
@@ -369,11 +372,11 @@ For example you might want to disable flushes if you detect the user has no netw
369372
}
370373
```
371374

372-
###Creating your own flush policies
375+
###Create your own flush policies
373376

374377
YoucancreateacustomFlushPolicyspecialforyourapplicationneedsbyimplementingthe `IFlushPolicy`interface.Youcanalsoextendthe `FlushPolicyBase`classthatalreadycreatesandhandlesthe `shouldFlush`valuereset.
375378

376-
A `FlushPolicy`onlyneedstoimplement2methods:
379+
A `FlushPolicy`onlyneedstoimplementtwoofthesemethods:
377380
- `Schedule`:Executedwhentheflushpolicyisenabledandaddedtotheclient.Thisisagoodplacetostartbackgroundoperations,makeasynccalls,configurethingsbeforeexecution
378381
- `UpdateState`:Getscalledoneveryeventtrackedbyyourclient
379382
- `Unschedule`:Calledwhenpolicyshouldstoprunninganyscheduledflushes

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp