This file contains hidden or 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
typealias TaskEngineMessageToProcess = MessageToProcess<TaskEngineMessage> | |
fun CoroutineScope.startPulsarTaskEngineWorker( | |
taskEngineConsumer: Consumer<TaskEngineEnvelope>, | |
taskEngine: TaskEngine, | |
logChannel: SendChannel<TaskEngineMessageToProcess>?, | |
enginesNumber: Int | |
) = launch(Dispatchers.IO) { | |
val taskInputChannel = Channel<TaskEngineMessageToProcess>() |
This file contains hidden or 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
@Serializable | |
data class TaskEngineEnvelope( | |
val taskId: TaskId, | |
val type: TaskEngineMessageType, | |
val dispatchTask: DispatchTask? = null, | |
val cancelTask: CancelTask? = null, | |
val taskCanceled: TaskCanceled? = null, | |
val taskCompleted: TaskCompleted? = null, | |
) { | |
init { |
This file contains hidden or 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
@Serializable | |
sealed class TaskEngineMessage() { | |
abstract val taskId: TaskId | |
} | |
@Serializable | |
data class DispatchTask( | |
override val taskId: TaskId, | |
val taskName: TaskName, | |
val methodName: MethodName, |
This file contains hidden or 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
import com.github.avrokotlin.avro4k.Avro | |
import com.github.avrokotlin.avro4k.io.AvroEncodeFormat | |
import io.infinitic.common.tasks.executors.messages.RunTask | |
import kotlinx.serialization.KSerializer | |
import org.apache.avro.file.SeekableByteArrayInput | |
import org.apache.avro.generic.GenericDatumReader | |
import org.apache.avro.generic.GenericRecord | |
import org.apache.avro.io.DecoderFactory | |
import org.apache.pulsar.client.api.Consumer | |
import org.apache.pulsar.client.api.Producer |
This file contains hidden or 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
function hello(name) { | |
console.log('Hello world ' + name) | |
} |
This file contains hidden or 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
function hello(name) { | |
console.log('Hello world ' + name) | |
} |
This file contains hidden or 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
const { Workflow, Task, Wait } = require("zenaton"); | |
// start child workflow | |
let StartChildWorkflow = Task("StartChildWorkflow", { | |
init(users, id) { | |
this.users = users; | |
this.id = id; | |
}, | |
handle: async function() { | |
await new ChildWorkflow(this.user, this.id).dispatch() |
This file contains hidden or 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
<?php | |
use Zenaton\Interfaces\WorkflowInterface; | |
use Zenaton\Tasks\Wait; | |
use Zenaton\Traits\Zenatonable; | |
class RequestManagementWorkflow implements WorkflowInterface | |
{ | |
use Zenatonable; |
This file contains hidden or 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
<?php | |
... | |
public function handle() | |
{ | |
... | |
// if no response received in 3 days | |
if (0 == count($this->quotations)) { |
This file contains hidden or 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
<?php | |
... | |
public function handle() | |
{ | |
... | |
// wait for at most 3 providers quotation, 3 days maximum | |
$event = (new Wait(ProvidersQuotationGatheredEvent::class))->days(3)->execute(); |
NewerOlder