mirror of https://github.com/deavmi/tasky.git
Compare commits
5 Commits
Author | SHA1 | Date |
---|---|---|
Tristan B. Velloza Kildaire | a51df3b699 | |
Tristan B. Velloza Kildaire | 8387d0ee78 | |
Tristan B. Velloza Kildaire | 7af21a909a | |
Tristan B. Velloza Kildaire | 7072c852dc | |
Tristan B. Velloza Kildaire | 93d6d49c20 |
|
@ -3,10 +3,9 @@ tasky
|
|||
|
||||
![](branding/logo.png)
|
||||
|
||||
## Creating a `Descriptor`
|
||||
## What is it?
|
||||
|
||||
Before we can spawn any jobs one needs to first create a description
|
||||
of the type of `Job` that will be spawned.
|
||||
TODO: Describe here.
|
||||
|
||||
|
||||
## Adding to your project
|
||||
|
|
|
@ -14,6 +14,8 @@ public class Engine
|
|||
|
||||
// TODO: Continue working on this
|
||||
|
||||
// TODO: Allow registering ResponseAnonymous with handlers etc
|
||||
|
||||
/**
|
||||
* Takes a request and sends it through to the endpoint
|
||||
* afterwhich we block for a response and when we get one
|
||||
|
@ -35,11 +37,16 @@ public class Engine
|
|||
/* Send the message */
|
||||
tManager.sendMessage(tReq);
|
||||
|
||||
/* Await for a response */
|
||||
byte[] resp = newQueue.dequeue().getPayload();
|
||||
/* Does this Request expect a response? */
|
||||
// TODO: We need not register the queue even if this is the case
|
||||
if(req.expectsResponse())
|
||||
{
|
||||
/* Await for a response */
|
||||
byte[] resp = newQueue.dequeue().getPayload();
|
||||
|
||||
/* Run the response handler with the response */
|
||||
req.process(resp);
|
||||
/* Run the response handler with the response */
|
||||
req.process(resp);
|
||||
}
|
||||
|
||||
/* De-register the queue */
|
||||
tManager.releaseQueue(newQueue);
|
||||
|
|
|
@ -7,8 +7,6 @@ public alias ResponseHandler = void function(byte[]);
|
|||
public abstract class Request
|
||||
{
|
||||
private byte[] requestMessage;
|
||||
|
||||
// TODO: Define the below with an alias for a function pointer that accepts a byte[] (the response data)
|
||||
|
||||
private ResponseHandler respFunc;
|
||||
|
||||
|
@ -18,6 +16,11 @@ public abstract class Request
|
|||
this.respFunc = respFunc;
|
||||
}
|
||||
|
||||
protected this(byte[] requestMessage)
|
||||
{
|
||||
this(requestMessage, null);
|
||||
}
|
||||
|
||||
package final byte[] getRequestData()
|
||||
{
|
||||
return requestMessage;
|
||||
|
@ -27,4 +30,9 @@ public abstract class Request
|
|||
{
|
||||
respFunc(responseData);
|
||||
}
|
||||
|
||||
package final bool expectsResponse()
|
||||
{
|
||||
return respFunc !is null;
|
||||
}
|
||||
}
|
16
todo.md
16
todo.md
|
@ -1,16 +0,0 @@
|
|||
# TODO
|
||||
|
||||
I think when we throw that session exception (even though that is the wrong) place,
|
||||
by throwing we may throw it when the next queue we'd iterate to was filled and we looped
|
||||
pver something flushed, but throw because invalid (now) queue operation
|
||||
|
||||
We should think about this and maybe chekc rather using a public, isAlice, and if so wthen finish up to try read as
|
||||
much as possible from the queues even when socket is dead but THEN never loop again (kill the Tasky loop).
|
||||
|
||||
It is always passing, but I should consider the above as it is a possible case.
|
||||
|
||||
But I do have something hanging, I need to check what that is, I believe wait that may be tristanable threads etc, I don't think newSys is erroring correctly
|
||||
|
||||
It might with or without newSys be hanging, socket error shit fr do be annoying me, idk needs more testing.
|
||||
|
||||
wait no shit looks fine lmao, we are reaching `"Err"` which is good
|
Loading…
Reference in New Issue