-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
103 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
checkout-core/src/main/java/com/adyen/checkout/core/DispatcherProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright (c) 2024 Adyen N.V. | ||
* | ||
* This file is open source and available under the MIT license. See the LICENSE file for more info. | ||
* | ||
* Created by ozgur on 16/10/2024. | ||
*/ | ||
|
||
package com.adyen.checkout.core | ||
|
||
import androidx.annotation.RestrictTo | ||
import kotlinx.coroutines.CoroutineDispatcher | ||
import kotlinx.coroutines.Dispatchers | ||
|
||
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) | ||
object DispatcherProvider { | ||
|
||
@Suppress("ktlint:standard:property-naming") | ||
var Main: CoroutineDispatcher = Dispatchers.Main | ||
private set | ||
|
||
@Suppress("ktlint:standard:property-naming") | ||
var IO: CoroutineDispatcher = Dispatchers.IO | ||
private set | ||
|
||
@Suppress("ktlint:standard:property-naming") | ||
var Default: CoroutineDispatcher = Dispatchers.Default | ||
private set | ||
|
||
fun setMain(dispatcher: CoroutineDispatcher) { | ||
this.Main = dispatcher | ||
} | ||
|
||
fun setIO(dispatcher: CoroutineDispatcher) { | ||
this.IO = dispatcher | ||
} | ||
|
||
fun setDefault(dispatcher: CoroutineDispatcher) { | ||
this.Default = dispatcher | ||
} | ||
|
||
fun resetMain() { | ||
Main = Dispatchers.Main | ||
} | ||
|
||
fun resetIO() { | ||
IO = Dispatchers.IO | ||
} | ||
|
||
fun resetDefault() { | ||
Default = Dispatchers.Default | ||
} | ||
|
||
fun resetAll() { | ||
resetMain() | ||
resetIO() | ||
resetDefault() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.