Hello
I try to get Shell output, but the Wait For never seems to fire, altough a TimeOut is set. I have this in my main code:
I have a module named Google with a GetUsers resumable sub:
I'm pretty sure the initialize is correct (I have used the GAM tool many times, this is the first time I wrote a method that actually needs to fetch a result)
Even if something is terrible wrong, I would expect the RunWithOutputEvents to timeout after 10 seconds and show something, but it doesn't.
The only log I get is Starting GetUsers. After that the code just keeps on running forever.
Is their something wrong with my Resumable Sub?
Thanks a lot.
I try to get Shell output, but the Wait For never seems to fire, altough a TimeOut is set. I have this in my main code:
B4X:
Sub AppStart (Args() As String)
Start
StartMessageLoop
End Sub
Sub Start()
Wait For (Google.GetUsers("xxxxxxxxx.com")) Complete ()
Log("Done")
End Sub
I have a module named Google with a GetUsers resumable sub:
B4X:
Public Sub GetUsers(DomainName As String) As ResumableSub
Log("Starting GetUsers")
Dim sh As Shell
sh.Initialize("", "GAM", Array As String("print", "users", "domain", DomainName))
sh.RunWithOutputEvents(10000)
Wait For (sh) ProcessCompleted(Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
If Success And ExitCode = 0 Then
Log("Worked")
Log(StdOut)
Else
Log("Error")
Log(StdErr)
End If
Log("GetUsers finished")
Return True
End Sub
I'm pretty sure the initialize is correct (I have used the GAM tool many times, this is the first time I wrote a method that actually needs to fetch a result)
Even if something is terrible wrong, I would expect the RunWithOutputEvents to timeout after 10 seconds and show something, but it doesn't.
The only log I get is Starting GetUsers. After that the code just keeps on running forever.
Is their something wrong with my Resumable Sub?
Thanks a lot.