servicecomb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: [Saga] About Omega's timeout process
Date Fri, 26 Apr 2019 00:36:37 GMT
We could introduce a Context object to let the user copy the thread
local variable across the thread.
The context can be inject into the method which is annotated with
Compasiable.  We may need to inject the Context object into the remote
service caller.

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Thu, Apr 25, 2019 at 3:59 PM Zheng Feng <zh.feng@gmail.com> wrote:
>
> Hi Willem,
>
> Can you explain more clear ? I can not understand why we need this API and
> how it could be used for passing the ThreadLocal variables ?
>
> Thanks,
> Zheng Feng
>
> Willem Jiang <willem.jiang@gmail.com> 于2019年4月25日周四 下午2:34写道:
>
> > What I mean is if the user using the ThreadLocal variable to store the
> > classloader  or security token, we need to have an API to let the user
> > pass these kind of information into the calling thread.
> >
> > Willem Jiang
> >
> > Twitter: willemjiang
> > Weibo: 姜宁willem
> >
> > On Thu, Apr 25, 2019 at 10:14 AM Zhang Lei <zhang_lei@boco.com.cn> wrote:
> > >
> > > In my example, I defined a runtime exception TimeoutAspectException,
> > user can know that a timeout has occurred when catching the exception
> > >
> > > The following unit test case tested a custom exception
> > TimeoutAspectException
> > >
> > >   @Test(expected = TimeoutAspectException.class)
> > >   public void timeoutCatchTimeoutAspectExceptionTest() throws
> > TimeoutAspectException {
> > >     List<User> users = new ArrayList<>();
> > >     users.add(User.builder().id(1).name("zhanglei").build());
> > >     myService.save(users, 3000);
> > >   }
> > >
> > > Lei Zhang
> > >
> > >
> > > > 在 2019年4月24日,下午10:16,Willem Jiang <willem.jiang@gmail.com>
写道:
> > > >
> > > > As the calling thread is change, we need to tell the user about it.
> > >
> >

Mime
View raw message