ilyalatt / Telega

C# Telegram MTProto Client
https://ilyalatt.github.io/Telega/
MIT License
58 stars 15 forks source link

New release #57

Closed ilyalatt closed 2 years ago

ilyalatt commented 3 years ago

Because of @GihanSoft recent activity I got interest to Telega. I wanted to simplify the public interface a long time ago. I realized that it is too hard for a lot of developers. Because of that some devs avoid the library. Now I feel that I can spend a few days to implement my plan. I want to gather what I made and what I want to make for the new release.

ilyalatt commented 3 years ago

@tarasverq @GihanSoft If you have any ideas about how to simplify Telega submit them here please

GihanSoft commented 3 years ago

You can use immutable arrays instead of read only list. It's part of .net standard (I think 2.1, and can be added to net standard 2.0 with nuget)

GihanSoft commented 3 years ago

Check function for still connection stable.

GihanSoft commented 3 years ago

Use SignInResult instead of exception. Exceptions have impact that effect performance a lot.

GihanSoft commented 3 years ago

Proxy. Specially socks5 and mt proto (Http can be added too)

GihanSoft commented 3 years ago

Set xml document in code for all public APIs. Start from Telegram Client. And web document and guides.

GihanSoft commented 3 years ago

Use rasolyn addins for async that can be added with nuget (don't include in build, just compile time.) Can help fix async problems.

GihanSoft commented 3 years ago

Change Upload to IO or UpDowdLoad or File or something like that. Because it uses for download too.

ilyalatt commented 3 years ago

Use SignInResult instead of exception. Exceptions have impact that effect performance a lot.

Performance is not critical on the sign in step. Much more CPU time is used for generating request. And a lot of time is just awaiting a call result. That's from pragmatic point of view. From theoretical point of view there is RpcResult that resembles needed behavior. CallUnsafe can be introduced that creates exception but not throws it. SignIn can check an exception and return an error instead of throwing an exception. But I am not sure because looks like it will complicate things more than needed.

GihanSoft commented 3 years ago

Use SignInResult instead of exception. Exceptions have impact that effect performance a lot.

Performance is not critical on the sign in step. Much more CPU time is used for generating request. And a lot of time is just awaiting a call result. That's from pragmatic point of view. From theoretical point of view there is RpcResult that resembles needed behavior. CallUnsafe can be introduced that creates exception but not throws it. SignIn can check an exception and return an error instead of throwing an exception. But I am not sure because looks like it will complicate things more than needed.

Ok, if it's not easy, no problem

tarasverq commented 3 years ago

Hi everybody!

My wish list is:

  1. Async version of Match methods
  2. Public ctor for TelegaClient (not sure if it is acceptable in functional style)
  3. ISessionStore with sessionKey in argument of Load method (I use more than one account at once, so I have to create SessionStore for each account)
tarasverq commented 3 years ago

One more request: parallel download and upload of file parts inside of TelegramClientUpload class. It should increase the speed of downloading and uploading.

May be I'll do it if you don't mind?

ilyalatt commented 3 years ago

One more request: parallel download and upload of file parts inside of TelegramClientUpload class. It should increase the speed of downloading and uploading.

May be I'll do it if you don't mind?

Yeah, Sure. You'll need to modify DelayMiddleware. Right now it puts all calls in a task queue. So it should ignore a task queue for file requests. Then you need to modify TaskQueue to allow count to be more than one. It will be used in Downloading/Uploading. Then you need to create a task queue with degree 4 for example and put calls in it. It will look like fileRequests.Select(x => _taskQueue.Put(_tg.Call(x))).

ilyalatt commented 2 years ago

There is a lot of stuff that was planned and never happened. What is done is published under v0.5.0. The rest is moved to #80.