You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importballerina/io;
listenerDEFep1=newDEF("DEF");
listenerABCep2=newABC("ABC");
publicfunction main() returnserror? {
io:println("main called");
// panic error("error from main");
}
function init() {
io:println("initializing current module");
}
public classABC {
privatestring name ="";
publicfunction init(stringname){
self.name=name;
}
publicfunction 'start() returnserror? {
io:println("listener start called - "+self.name);
if (self.name=="ABC") {
errorsampleErr=error("panicked while starting listener attached with "+self.name);
panicsampleErr;
}
}
publicfunction gracefulStop() returnserror? {
io:println("listener gracefulStop called - "+self.name);
return ();
}
publicfunction immediateStop() returnserror? {
io:println("listener immediateStop called - "+self.name);
return ();
}
publicfunction attach(serviceobject {} s, string[]|string? name= ()) returnserror? {
io:println("listener attach called - "+self.name);
}
publicfunction detach(serviceobject {} s) returnserror? {
io:println("listener detach called - "+self.name);
}
}
public classDEF {
privatestring name ="";
publicfunction init(stringname){
self.name=name;
}
publicfunction 'start() returnserror? {
io:println("listener start called - "+self.name);
if (self.name=="DEF") {
errorsampleErr=error("panicked while starting listener attached with "+self.name);
panicsampleErr;
}
}
publicfunction gracefulStop() returnserror? {
io:println("listener gracefulStop called - "+self.name);
return ();
}
publicfunction immediateStop() returnserror? {
io:println("listener immediateStop called - "+self.name);
return ();
}
publicfunction attach(serviceobject {} s, string[]|string? name= ()) returnserror? {
io:println("listener attach called - "+self.name);
}
publicfunction detach(serviceobject {} s) returnserror? {
io:println("listener detach called - "+self.name);
}
}
Output:
initializing current module
main called
listener start called - DEF
error: panicked while starting listener attached with DEF
at DEF:start(Foo.bal:328)
listener gracefulStop called - DEF
listener gracefulStop called - ABC
Here the gracefulStop() method of listener bound with ABC has been called even without the 'start method of it get called.
Affected Version(s)
2201.8.x
OS, DB, other environment details and versions
No response
Related area
-> Runtime
Related issue(s) (optional)
No response
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response
The text was updated successfully, but these errors were encountered:
Description
$title
Steps to Reproduce
Output:
Here the
gracefulStop()
method of listener bound withABC
has been called even without the'start
method of it get called.Affected Version(s)
2201.8.x
OS, DB, other environment details and versions
No response
Related area
-> Runtime
Related issue(s) (optional)
No response
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response
The text was updated successfully, but these errors were encountered: