LiangliangSui commented on issue #1458:
URL: 
https://github.com/apache/incubator-fury/issues/1458#issuecomment-2034781233

   > I couldn't find any method in the builder to register classes. How can I 
register classes using the Fury builder?
   
   `FuryBuilder` cannot register classes directly. You need to use 
`Fury#register(...)` to register. However, we can make `FuryBuilder` support 
registration. I will submit a PR to do this later.
   
   
   > Secondly, I'm unsure about when to use buildThreadSafeFury and when to 
instantiate ThreadLocalFury directly. The documentation doesn't provide clear 
guidance on this.
   
   The implementation principle of `buildThreadSafeFury` is also to directly 
instantiate the `ThreadLocalFury` object(see 
[code](https://github.com/apache/incubator-fury/blob/main/java/fury-core/src/main/java/org/apache/fury/config/FuryBuilder.java#L336-L350)),
 and pass a lambda expression to the constructor of `ThreadLocalFury` to create 
a Fury instance.
   
   In the expression passed in when you instantiate `ThreadLocalFury` yourself, 
you can do some operations on the Fury instance by default. For example, you 
can register the `FooClass` class for each thread Fury instance, which is 
something buildThreadSafeFury cannot do.
   
   Directly instantiating `ThreadLocalFury` is more flexible than 
`buildThreadSafeFury`.
   
   There is currently no essential difference between the two implementations. 
In the future, we will use 
[`buildThreadSafeFuryPool`](https://github.com/apache/incubator-fury/blob/main/java/fury-core/src/main/java/org/apache/fury/config/FuryBuilder.java#L359-L361)
 as the default implementation of `buildThreadSafeFury`. #1335 
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to