Re: event to create asynchronous task

Carlos Rodríguez <[email protected]> Mon, 25 Jul 2016 08:47:03 -0500
Newsgroups gmane.comp.otrs.devel
Message-ID <[email protected]>
--===============4299683255296806911==
Content-Type: multipart/signed; boundary="Apple-Mail=_C1F50D63-5BB5-4E91-81AC-11FDA1DCC8B7"; protocol="application/pgp-signature"; micalg=pgp-sha256


--Apple-Mail=_C1F50D63-5BB5-4E91-81AC-11FDA1DCC8B7
Content-Type: multipart/alternative;
	boundary="Apple-Mail=_078A7521-1DB7-490B-B8B4-D2F55B282EEC"


--Apple-Mail=_078A7521-1DB7-490B-B8B4-D2F55B282EEC
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=windows-1252

Hello,

All you need to do is just  this call in your event handler

    my $Success =3D $Object->AsyncCall(
        ObjectName               =3D> 'Kernel::System::Ticket',   # =
optional, if not given the object is used from where
                                                                # this =
function was called
        FunctionName             =3D> 'MyFunction',               # the =
name of the function to execute
        FunctionParams           =3D> \%MyParams,                 # a =
ref with the required parameters for the function
        Attempts                 =3D> 3,                          # =
optional, default: 1, number of tries to lock the
                                                                #   task =
by the scheduler
        MaximumParallelInstances =3D> 1,                          # =
optional, default: 0 (unlimited), number of same
                                                                #   =
function calls from the same object that can be
                                                                #   =
executed at the the same time
    );

This verifies that the object exists and that can execute the function, =
after that it create a task for the Daemon.

Then the Daemon read the task and execute it.

For the documentation issues please rise a bug report, apparently that =
part was not updated from 4 to 5.

((enjoy))

Carlos Rodr=EDguez




> On Jul 25, 2016, at 3:40 AM, Moritz Lenz <[email protected]> wrote:
>=20
> Hi,
>=20
> On 25.07.2016 10:02, Juan Manuel Clavero Almir=F3n wrote:
>> Hi all,
>>=20
>>=20
>>=20
>> I have an event module that takes too much time so the user response
>> time is ridiculous. I was thinking of creating a new asynchronous =
task
>> from the event and then run the actions on the background.
>>=20
>>=20
>>=20
>> I=92ve been reading the OTRS 5.0 dev manual : it refers to the task
>> handler and shows a test module located in
>> Kernel/Scheduler/TaskHandler/Test.pm, but my OTRS install doesn=92t =
have
>> any Scheduler folder.
>>=20
>>=20
>>=20
>> The admin manual refers to the OTRS Daemon, new feature in OTRS 5, =
and
>> I=92ve located some modules in the System folder, but I cannot find =
any
>> document on how to create a new process for the daemon.
>=20
> =
https://otrs.github.io/doc/manual/developer/stable/en/html/architecture-ov=
erview.html#Scheduler-TaskHandler =
<https://otrs.github.io/doc/manual/developer/stable/en/html/architecture-o=
verview.html#Scheduler-TaskHandler>
> talks about
> $OTRS_HOME/Kernel/Scheduler/TaskHandler/GenericInterface.pm, but I =
think
> the proper location is
> =
$OTRS_HOME/Kernel/System/Daemon/DaemonModules/SchedulerTaskWorker/GenericI=
nterface.pm
>=20
> But I don't think you have to actually touch any of the DaemonModules,
> the existing AsynchronousExecutor should do just fine.
>=20
>> Can anybody refer to some guide or explain how to register a new
>> asynchronous task?
>=20
> Here is an example of a task that is being executed asynchronously:
>=20
> =
https://github.com/OTRS/otrs/blob/43abbee47642a486177bb4ffe39c3677bdcaca52=
/Kernel/System/Web/InterfaceAgent.pm#L385-L394 =
<https://github.com/OTRS/otrs/blob/43abbee47642a486177bb4ffe39c3677bdcaca5=
2/Kernel/System/Web/InterfaceAgent.pm#L385-L394>
>=20
> So one thing you could do is to write an ordinary, synchronous event
> that, like the example above, calls TaskAdd with Type =3D>
> 'AsynchronousExecutor' on a Kernel::System::Scheduler object. And
> another function which does the slow work you need to do, and then the
> Scheduler executes that for you in the background.
>=20
> Of course, that's all a very indirect way to approach that (but one =
that
> works without patching OTRS itself).
>=20
> I'd rather see a patch to Kernel::System::EventHandler that directly
> supports asynchronous execution, so that you could get rid of a =
writing
> a synchronous event that just triggers an asynchronous task.
>=20
> Best regards,
> Moritz
> _______________________________________________
> OTRS mailing list: dev - Webpage: http://otrs.org/ <http://otrs.org/>
> Archive: http://lists.otrs.org/pipermail/dev =
<http://lists.otrs.org/pipermail/dev>
> To unsubscribe: http://lists.otrs.org/mailman/listinfo/dev =
<http://lists.otrs.org/mailman/listinfo/dev>

--Apple-Mail=_078A7521-1DB7-490B-B8B4-D2F55B282EEC
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=windows-1252

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html =
charset=3Dwindows-1252"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" =
class=3D"">Hello,<div class=3D""><br class=3D""></div><div class=3D"">All =
you need to do is just &nbsp;this call in your event handler</div><div =
class=3D""><br class=3D""></div><div class=3D""><div class=3D""><font =
face=3D"Monaco" style=3D"font-size: 9px;" class=3D"">&nbsp; &nbsp; my =
$Success =3D $Object-&gt;AsyncCall(</font></div><div class=3D""><font =
face=3D"Monaco" style=3D"font-size: 9px;" class=3D"">&nbsp; &nbsp; =
&nbsp; &nbsp; ObjectName &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; =3D&gt; 'Kernel::System::Ticket', &nbsp; # optional, if not given =
the object is used from where</font></div><div class=3D""><font =
face=3D"Monaco" style=3D"font-size: 9px;" class=3D"">&nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # =
this function was called</font></div><div class=3D""><font face=3D"Monaco"=
 style=3D"font-size: 9px;" class=3D"">&nbsp; &nbsp; &nbsp; &nbsp; =
FunctionName &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =3D&gt; =
'MyFunction', &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # the =
name of the function to execute</font></div><div class=3D""><font =
face=3D"Monaco" style=3D"font-size: 9px;" class=3D"">&nbsp; &nbsp; =
&nbsp; &nbsp; FunctionParams &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =3D&gt; =
\%MyParams, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # a =
ref with the required parameters for the function</font></div><div =
class=3D""><font face=3D"Monaco" style=3D"font-size: 9px;" =
class=3D"">&nbsp; &nbsp; &nbsp; &nbsp; Attempts &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =3D&gt; 3, &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# =
optional, default: 1, number of tries to lock the</font></div><div =
class=3D""><font face=3D"Monaco" style=3D"font-size: 9px;" =
class=3D"">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; task by the =
scheduler</font></div><div class=3D""><font face=3D"Monaco" =
style=3D"font-size: 9px;" class=3D"">&nbsp; &nbsp; &nbsp; &nbsp; =
MaximumParallelInstances =3D&gt; 1, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# optional, =
default: 0 (unlimited), number of same</font></div><div class=3D""><font =
face=3D"Monaco" style=3D"font-size: 9px;" class=3D"">&nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # =
&nbsp; function calls from the same object that can be</font></div><div =
class=3D""><font face=3D"Monaco" style=3D"font-size: 9px;" =
class=3D"">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; executed at the the same =
time</font></div><div class=3D""><font face=3D"Monaco" style=3D"font-size:=
 9px;" class=3D"">&nbsp; &nbsp; );</font></div><div class=3D""><br =
class=3D""></div><div class=3D"">This verifies that the object exists =
and that can execute the function, after that it create a task for the =
Daemon.</div><div class=3D""><br class=3D""></div><div class=3D"">Then =
the Daemon read the task and execute it.</div><div class=3D""><br =
class=3D""></div><div class=3D"">For the documentation issues please =
rise a bug report, apparently that part was not updated from 4 to =
5.</div><div class=3D""><br class=3D""></div><div class=3D"">
<span class=3D"Apple-style-span" style=3D"border-collapse: separate; =
font-variant-ligatures: normal; font-variant-position: normal; =
font-variant-numeric: normal; font-variant-alternates: normal; =
font-variant-east-asian: normal; line-height: normal; border-spacing: =
0px;"><div class=3D""><font class=3D"Apple-style-span" =
color=3D"#940D09">((enjoy))</font></div><div class=3D""><font =
class=3D"Apple-style-span" color=3D"#940D09"><br =
class=3D""></font></div><div class=3D""><font class=3D"Apple-style-span" =
color=3D"#940D09">Carlos Rodr=EDguez</font></div><div class=3D""><br =
class=3D""></div><div class=3D""><br class=3D""></div></span><br =
class=3D"Apple-interchange-newline">
</div>
<br class=3D""><div><blockquote type=3D"cite" class=3D""><div =
class=3D"">On Jul 25, 2016, at 3:40 AM, Moritz Lenz &lt;<a =
href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a>&gt; wrote:</div><br =
class=3D"Apple-interchange-newline"><div class=3D""><span =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
orphans: auto; text-align: start; text-indent: 0px; text-transform: =
none; white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; float: none; display: inline =
!important;" class=3D"">Hi,</span><br style=3D"font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant-caps: normal; =
font-weight: normal; letter-spacing: normal; orphans: auto; text-align: =
start; text-indent: 0px; text-transform: none; white-space: normal; =
widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" =
class=3D""><br style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; orphans: auto; text-align: start; text-indent: =
0px; text-transform: none; white-space: normal; widows: auto; =
word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=3D""><span =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
orphans: auto; text-align: start; text-indent: 0px; text-transform: =
none; white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; float: none; display: inline =
!important;" class=3D"">On 25.07.2016 10:02, Juan Manuel Clavero Almir=F3n=
 wrote:</span><br style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; orphans: auto; text-align: start; text-indent: =
0px; text-transform: none; white-space: normal; widows: auto; =
word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=3D""><blockquote=
 type=3D"cite" style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; orphans: auto; text-align: start; text-indent: =
0px; text-transform: none; white-space: normal; widows: auto; =
word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=3D"">Hi =
all,<br class=3D""><br class=3D""><br class=3D""><br class=3D"">I have =
an event module that takes too much time so the user response<br =
class=3D"">time is ridiculous. I was thinking of creating a new =
asynchronous task<br class=3D"">from the event and then run the actions =
on the background.<br class=3D""><br class=3D""><br class=3D""><br =
class=3D"">I=92ve been reading the OTRS 5.0 dev manual : it refers to =
the task<br class=3D"">handler and shows a test module located in<br =
class=3D"">Kernel/Scheduler/TaskHandler/Test.pm, but my OTRS install =
doesn=92t have<br class=3D"">any Scheduler folder.<br class=3D""><br =
class=3D""><br class=3D""><br class=3D"">The admin manual refers to the =
OTRS Daemon, new feature in OTRS 5, and<br class=3D"">I=92ve located =
some modules in the System folder, but I cannot find any<br =
class=3D"">document on how to create a new process for the daemon.<br =
class=3D""></blockquote><br style=3D"font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: =
normal; letter-spacing: normal; orphans: auto; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; widows: =
auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=3D""><a =
href=3D"https://otrs.github.io/doc/manual/developer/stable/en/html/archite=
cture-overview.html#Scheduler-TaskHandler" style=3D"font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: =
0px;" =
class=3D"">https://otrs.github.io/doc/manual/developer/stable/en/html/arch=
itecture-overview.html#Scheduler-TaskHandler</a><br style=3D"font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: =
0px;" class=3D""><span style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; orphans: auto; text-align: start; text-indent: =
0px; text-transform: none; white-space: normal; widows: auto; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: =
inline !important;" class=3D"">talks about</span><br style=3D"font-family:=
 Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: =
0px;" class=3D""><span style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; orphans: auto; text-align: start; text-indent: =
0px; text-transform: none; white-space: normal; widows: auto; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: =
inline !important;" =
class=3D"">$OTRS_HOME/Kernel/Scheduler/TaskHandler/GenericInterface.pm, =
but I think</span><br style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; orphans: auto; text-align: start; text-indent: =
0px; text-transform: none; white-space: normal; widows: auto; =
word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=3D""><span =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
orphans: auto; text-align: start; text-indent: 0px; text-transform: =
none; white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; float: none; display: inline =
!important;" class=3D"">the proper location is</span><br =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
orphans: auto; text-align: start; text-indent: 0px; text-transform: =
none; white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-stroke-width: 0px;" class=3D""><span style=3D"font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
float: none; display: inline !important;" =
class=3D"">$OTRS_HOME/Kernel/System/Daemon/DaemonModules/SchedulerTaskWork=
er/GenericInterface.pm</span><br style=3D"font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant-caps: normal; =
font-weight: normal; letter-spacing: normal; orphans: auto; text-align: =
start; text-indent: 0px; text-transform: none; white-space: normal; =
widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" =
class=3D""><br style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; orphans: auto; text-align: start; text-indent: =
0px; text-transform: none; white-space: normal; widows: auto; =
word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=3D""><span =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
orphans: auto; text-align: start; text-indent: 0px; text-transform: =
none; white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; float: none; display: inline =
!important;" class=3D"">But I don't think you have to actually touch any =
of the DaemonModules,</span><br style=3D"font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant-caps: normal; =
font-weight: normal; letter-spacing: normal; orphans: auto; text-align: =
start; text-indent: 0px; text-transform: none; white-space: normal; =
widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" =
class=3D""><span style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; orphans: auto; text-align: start; text-indent: =
0px; text-transform: none; white-space: normal; widows: auto; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: =
inline !important;" class=3D"">the existing AsynchronousExecutor should =
do just fine.</span><br style=3D"font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: =
normal; letter-spacing: normal; orphans: auto; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; widows: =
auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=3D""><br =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
orphans: auto; text-align: start; text-indent: 0px; text-transform: =
none; white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-stroke-width: 0px;" class=3D""><blockquote type=3D"cite" =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
orphans: auto; text-align: start; text-indent: 0px; text-transform: =
none; white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-stroke-width: 0px;" class=3D"">Can anybody refer to some =
guide or explain how to register a new<br class=3D"">asynchronous =
task?<br class=3D""></blockquote><br style=3D"font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant-caps: normal; =
font-weight: normal; letter-spacing: normal; orphans: auto; text-align: =
start; text-indent: 0px; text-transform: none; white-space: normal; =
widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" =
class=3D""><span style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; orphans: auto; text-align: start; text-indent: =
0px; text-transform: none; white-space: normal; widows: auto; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: =
inline !important;" class=3D"">Here is an example of a task that is =
being executed asynchronously:</span><br style=3D"font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: =
0px;" class=3D""><br style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; orphans: auto; text-align: start; text-indent: =
0px; text-transform: none; white-space: normal; widows: auto; =
word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=3D""><a =
href=3D"https://github.com/OTRS/otrs/blob/43abbee47642a486177bb4ffe39c3677=
bdcaca52/Kernel/System/Web/InterfaceAgent.pm#L385-L394" =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
orphans: auto; text-align: start; text-indent: 0px; text-transform: =
none; white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-stroke-width: 0px;" =
class=3D"">https://github.com/OTRS/otrs/blob/43abbee47642a486177bb4ffe39c3=
677bdcaca52/Kernel/System/Web/InterfaceAgent.pm#L385-L394</a><br =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
orphans: auto; text-align: start; text-indent: 0px; text-transform: =
none; white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-stroke-width: 0px;" class=3D""><br style=3D"font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: =
0px;" class=3D""><span style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; orphans: auto; text-align: start; text-indent: =
0px; text-transform: none; white-space: normal; widows: auto; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: =
inline !important;" class=3D"">So one thing you could do is to write an =
ordinary, synchronous event</span><br style=3D"font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant-caps: normal; =
font-weight: normal; letter-spacing: normal; orphans: auto; text-align: =
start; text-indent: 0px; text-transform: none; white-space: normal; =
widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" =
class=3D""><span style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; orphans: auto; text-align: start; text-indent: =
0px; text-transform: none; white-space: normal; widows: auto; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: =
inline !important;" class=3D"">that, like the example above, calls =
TaskAdd with Type =3D&gt;</span><br style=3D"font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant-caps: normal; =
font-weight: normal; letter-spacing: normal; orphans: auto; text-align: =
start; text-indent: 0px; text-transform: none; white-space: normal; =
widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" =
class=3D""><span style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; orphans: auto; text-align: start; text-indent: =
0px; text-transform: none; white-space: normal; widows: auto; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: =
inline !important;" class=3D"">'AsynchronousExecutor' on a =
Kernel::System::Scheduler object. And</span><br style=3D"font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: =
0px;" class=3D""><span style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; orphans: auto; text-align: start; text-indent: =
0px; text-transform: none; white-space: normal; widows: auto; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: =
inline !important;" class=3D"">another function which does the slow work =
you need to do, and then the</span><br style=3D"font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant-caps: normal; =
font-weight: normal; letter-spacing: normal; orphans: auto; text-align: =
start; text-indent: 0px; text-transform: none; white-space: normal; =
widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" =
class=3D""><span style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; orphans: auto; text-align: start; text-indent: =
0px; text-transform: none; white-space: normal; widows: auto; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: =
inline !important;" class=3D"">Scheduler executes that for you in the =
background.</span><br style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; orphans: auto; text-align: start; text-indent: =
0px; text-transform: none; white-space: normal; widows: auto; =
word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=3D""><br =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
orphans: auto; text-align: start; text-indent: 0px; text-transform: =
none; white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-stroke-width: 0px;" class=3D""><span style=3D"font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
float: none; display: inline !important;" class=3D"">Of course, that's =
all a very indirect way to approach that (but one that</span><br =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
orphans: auto; text-align: start; text-indent: 0px; text-transform: =
none; white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-stroke-width: 0px;" class=3D""><span style=3D"font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
float: none; display: inline !important;" class=3D"">works without =
patching OTRS itself).</span><br style=3D"font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant-caps: normal; =
font-weight: normal; letter-spacing: normal; orphans: auto; text-align: =
start; text-indent: 0px; text-transform: none; white-space: normal; =
widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" =
class=3D""><br style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; orphans: auto; text-align: start; text-indent: =
0px; text-transform: none; white-space: normal; widows: auto; =
word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=3D""><span =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
orphans: auto; text-align: start; text-indent: 0px; text-transform: =
none; white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; float: none; display: inline =
!important;" class=3D"">I'd rather see a patch to =
Kernel::System::EventHandler that directly</span><br style=3D"font-family:=
 Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: =
0px;" class=3D""><span style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; orphans: auto; text-align: start; text-indent: =
0px; text-transform: none; white-space: normal; widows: auto; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: =
inline !important;" class=3D"">supports asynchronous execution, so that =
you could get rid of a writing</span><br style=3D"font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: =
0px;" class=3D""><span style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; orphans: auto; text-align: start; text-indent: =
0px; text-transform: none; white-space: normal; widows: auto; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: =
inline !important;" class=3D"">a synchronous event that just triggers an =
asynchronous task.</span><br style=3D"font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: =
normal; letter-spacing: normal; orphans: auto; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; widows: =
auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=3D""><br =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
orphans: auto; text-align: start; text-indent: 0px; text-transform: =
none; white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-stroke-width: 0px;" class=3D""><span style=3D"font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
float: none; display: inline !important;" class=3D"">Best =
regards,</span><br style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; orphans: auto; text-align: start; text-indent: =
0px; text-transform: none; white-space: normal; widows: auto; =
word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=3D""><span =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
orphans: auto; text-align: start; text-indent: 0px; text-transform: =
none; white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; float: none; display: inline =
!important;" class=3D"">Moritz</span><br style=3D"font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: =
0px;" class=3D""><span style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; orphans: auto; text-align: start; text-indent: =
0px; text-transform: none; white-space: normal; widows: auto; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: =
inline !important;" =
class=3D"">_______________________________________________</span><br =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
orphans: auto; text-align: start; text-indent: 0px; text-transform: =
none; white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-stroke-width: 0px;" class=3D""><span style=3D"font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
float: none; display: inline !important;" class=3D"">OTRS mailing list: =
dev - Webpage:<span class=3D"Apple-converted-space">&nbsp;</span></span><a=
 href=3D"http://otrs.org/" style=3D"font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: =
normal; letter-spacing: normal; orphans: auto; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; widows: =
auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" =
class=3D"">http://otrs.org/</a><br style=3D"font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant-caps: normal; =
font-weight: normal; letter-spacing: normal; orphans: auto; text-align: =
start; text-indent: 0px; text-transform: none; white-space: normal; =
widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" =
class=3D""><span style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; orphans: auto; text-align: start; text-indent: =
0px; text-transform: none; white-space: normal; widows: auto; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: =
inline !important;" class=3D"">Archive:<span =
class=3D"Apple-converted-space">&nbsp;</span></span><a =
href=3D"http://lists.otrs.org/pipermail/dev" style=3D"font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: =
0px;" class=3D"">http://lists.otrs.org/pipermail/dev</a><br =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
orphans: auto; text-align: start; text-indent: 0px; text-transform: =
none; white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-stroke-width: 0px;" class=3D""><span style=3D"font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
float: none; display: inline !important;" class=3D"">To =
unsubscribe:<span class=3D"Apple-converted-space">&nbsp;</span></span><a =
href=3D"http://lists.otrs.org/mailman/listinfo/dev" style=3D"font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: =
0px;" =
class=3D"">http://lists.otrs.org/mailman/listinfo/dev</a></div></blockquot=
e></div><br class=3D""></div></body></html>=

--Apple-Mail=_078A7521-1DB7-490B-B8B4-D2F55B282EEC--

--Apple-Mail=_C1F50D63-5BB5-4E91-81AC-11FDA1DCC8B7
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iQEcBAEBCAAGBQJXlhhYAAoJEAAgDEqQhBeVJNkIAJZV7deQ2/YELLKrwOnNXhRc
P01HyoYeNBfpjV0ZmQ+A5wDnXbbvE5cwT8kMLZQkE65UWTOuu8xBE5YlB44hmTsv
GiGj27WXNpCKgyJFChFkzw2VELSqTD1vPq8jQpTg16/tXxe1YxnaDKbf/cr2+zlk
yeOzFiy7LvRsbRxP3gWUxckJrbWcZ6b81NyOx8KGIGCbnciygYbJnwMKCGLxw7WM
g20CbuQXTIJ2kmDy7Ld7SNDxwYAhCMpeDC36k1MZPQWckz+mw4eT661hAjH+RGj3
48x+YcFdZRVaKv306mEmewojkvjsLc2iPF7+GPXW6PKYPV+11M4tJmpk68yJvHA=
=KbSN
-----END PGP SIGNATURE-----

--Apple-Mail=_C1F50D63-5BB5-4E91-81AC-11FDA1DCC8B7--


--===============4299683255296806911==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
OTRS mailing list: dev - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/dev
To unsubscribe: http://lists.otrs.org/mailman/listinfo/dev
--===============4299683255296806911==--