|
321 | 321 | * Synchronizer, and is used for debugging purposes. |
322 | 322 | * |
323 | 323 | * The SynchronizerStats object contains a count of the number of times the |
324 | | - * Persister has sent and received messages. |
| 324 | + * Synchronizer has sent and received messages. |
325 | 325 | * |
326 | 326 | * The method is intended to be used during development to ensure your |
327 | 327 | * synchronization layer is acting as expected, for example. |
|
370 | 370 | * must provide parameters which identify how to send and receive changes to and |
371 | 371 | * from this MergeableStore and its peers. This is entirely dependent upon the |
372 | 372 | * medium of communication used. |
| 373 | + * |
| 374 | + * You must also provide a callback for when the Synchronizer is destroyed |
| 375 | + * (which is a good place to clean up resources and stop communication |
| 376 | + * listeners), and indicate how long the Synchronizer will wait for responses to |
| 377 | + * message requests before timing out. |
| 378 | + * |
| 379 | + * A final set of optional handlers can be provided to help debug sends, |
| 380 | + * receives, and errors respectively. |
373 | 381 | * @param store The MergeableStore to synchronize. |
374 | 382 | * @param send A Send function for sending a message. |
375 | 383 | * @param registerReceive A callback (called once when the Synchronizer is |
376 | 384 | * created) that is passed a Receive function that you need to ensure will |
377 | 385 | * receive messages addressed or broadcast to this client. |
378 | | - * @param destroy A function called when destroying the Persister which can be |
379 | | - * used to clean up underlying resources. |
| 386 | + * @param destroy A function called when destroying the Synchronizer which can |
| 387 | + * be used to clean up underlying resources. |
380 | 388 | * @param requestTimeoutSeconds An number of seconds before a request sent from |
381 | | - * this Persister to another peer times out. |
| 389 | + * this Synchronizer to another peer times out. |
| 390 | + * @param onSend An optional handler for the messages that this Synchronizer |
| 391 | + * sends. This is suitable for debugging synchronization issues in a development |
| 392 | + * environment, since v5.1. |
| 393 | + * @param onReceive An optional handler for the messages that this Synchronizer |
| 394 | + * receives. This is suitable for debugging synchronization issues in a |
| 395 | + * development environment, since v5.1. |
382 | 396 | * @param onIgnoredError An optional handler for the errors that the |
383 | 397 | * Synchronizer would otherwise ignore when trying to synchronize data. This is |
384 | 398 | * suitable for debugging synchronization issues in a development environment. |
|
0 commit comments